---
title: Shopify overview & authentication
sidebarTitle: Overview & authentication
---

## Overview

Our Shopify integration allows you to create triggers and tasks that interact with Shopify. Trigger jobs when events happen, like when a new product is added to a shop, or when an order is paid for, etc. You can also perform tasks like creating products, editing variants, getting information about an order, and a lot more.

## Installing the Shopify packages

To get started with our Shopify integration, you need to install the `@trigger.dev/shopify` packages. You can do this using `npm`, `pnpm`, or `yarn`:

<CodeGroup>

```bash npm
npm install @trigger.dev/shopify@latest
```

```bash pnpm
pnpm install @trigger.dev/shopify@latest
```

```bash yarn
yarn add @trigger.dev/shopify@latest
```

</CodeGroup>

## Runtime Adapter

It's **required** to import the correct Runtime Adapter for your platform. All examples will use the Node.js adapter, but you can change this to any of the following or even create your own [custom adapter](https://github.com/Shopify/shopify-api-js/blob/6adccd72527dc1fcf387adf09c5522010b6f31f2/packages/shopify-api/docs/guides/runtimes.md).

<Warning>Only import **one** adapter!</Warning>

```ts
// Import the Node.js adapter
import "@shopify/shopify-api/adapters/node";

// Import the CloudFlare Worker adapter
import "@shopify/shopify-api/adapters/cf-worker";

// Import the generic Web API adapter
import "@shopify/shopify-api/adapters/web-api";
```

You can then import and use `@trigger.dev/shopify` like any other integration:

```ts
import "@shopify/shopify-api/adapters/node";
import { Shopify } from "@trigger.dev/shopify";

const shopify = new Shopify({
  ...
});
```

## Authentication

You can use Personal Access Tokens to authenticate with Shopify and get started with building custom apps.

### Personal Access Tokens

To create the tokens on Shopify, login and [follow the instructions](https://help.shopify.com/en/manual/apps/app-types/custom-apps#create-and-install-a-custom-app).

The [required scopes](https://shopify.dev/docs/api/usage/access-scopes#authenticated-access-scopes) depend on the tasks you wish to perform and which webhooks you intend to receive.

Webhooks will generally need read access to the respective Shopify resource at the very least. If the topic you subscribe to is triggered by an action that requires write access, e.g. `orders/create`, then write access is also required, e.g. `write_orders`.

Additionally, you will also have to provide your shop domain.

```ts my-job.ts
import "@shopify/shopify-api/adapters/node";
import { Shopify } from "@trigger.dev/shopify";

//create Shopify client using a token
const shopify = new Shopify({
  id: "shopify",
  adminAccessToken: process.env.SHOPIFY_ADMIN_ACCESS_TOKEN!,
  apiKey: process.env.SHOPIFY_API_KEY!,
  apiSecretKey: process.env.SHOPIFY_API_SECRET_KEY!,
  hostName: process.env.SHOPIFY_SHOP_DOMAIN!,
});
...
```

## Triggers and Tasks

Once you have set up a Shopify client, you can use it to create triggers and tasks.

<CardGroup cols={2}>
  <Card title="Triggers" icon="stars" href="/integrations/apis/shopify-triggers">
    Trigger Jobs when events happen in Shopify, like a deleted product or a paid order.
  </Card>
  <Card title="Tasks" icon="sparkles" href="/integrations/apis/shopify-tasks">
    Perform Tasks such as creating new variants, or editing orders, and more.
  </Card>
</CardGroup>

## Example jobs

<Card title="Code examples" icon="code" href="https://trigger.dev/apis/shopify">
  Check out pre-built jobs using Shopify in our API section.
</Card>
