Skip to main content
Deno 2 is finally here 🎉️
Learn more

Deno Shopify

Configuration

import { Shopify } from "https://deno.land/x/deno_shopify@v0.1.2/mod.ts";

const shop = new Shopify({
  apiKey: "...",
  password: "...",
  myshopify: "[...].myshopify.com",
});

Themes

Get all themes

Returns an object array of Theme

getThemes(): Promise<Theme[]>

Get theme

Returns the Theme associated object

getTheme(themeId: number): Promise<Theme>

Get the main theme

Returns the actual main Theme of your Shop

mainTheme(): Promise<Theme | null>

Create theme

Create and returns a new Theme.
Shopify documentation

createTheme(theme: {
  name: string;
  src: string;
  role: "main" | "unpublished"
 }): Promise<Theme>

Update theme

Update and returns a Theme.
Shopify documentation

async updateTheme(
  themeId: number,
  config: {
    name?: string;
    role?: "main" | "unpublished"
  },
): Promise<Theme>

Delete theme

Delete and returns a Theme.
Shopify documentation

async deleteTheme(themeId: string): Promise<Theme>

Assets

Get an asset

Retrieve an Asset.
Shopify documentation object

async getAssets(themeId: number): Promise<Asset[]>

Create an asset

Create and returns an Asset.
Shopify documentation object

async createAsset(
  themeId: number,
  path: string,
  value: {
    value?: string;
    attachment?: string;
    src?: string;
    source_key?: string;
  },
): Promise<Asset>

Delete an asset

async deleteAsset(
  themeId: string,
  path: string,
): Promise<{ message: string }>