npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

nuxt-shopify-embedded

v0.1.8

Published

Nuxt module for building Shopify embedded apps with Polaris components, App Bridge, and GraphQL client

Readme

nuxt-shopify-embedded

npm version npm downloads License Nuxt

Nuxt module for building Shopify embedded apps with ease.

Features

  • 🔐 Shopify API Client — Pre-configured @shopify/shopify-api instance with automatic settings
  • 📊 GraphQL Client — Type-safe GraphQL queries with session management
  • 🎨 Polaris Components — Use Shopify Polaris web components (<s-*> tags) out of the box
  • 🌉 App Bridge CDN — Automatic injection of App Bridge and Polaris scripts
  • 📦 Type-Safe Config — Full TypeScript support with runtime configuration
  • 🔧 Auto-Imports — Server composables auto-imported, ready to use

Quick Setup

1. Install the module

# Using pnpm
pnpm add nuxt-shopify-embedded

# Using npm
npm install nuxt-shopify-embedded

# Using yarn
yarn add nuxt-shopify-embedded

2. Add to your Nuxt config

// nuxt.config.ts
export default defineNuxtConfig({
  modules: ['nuxt-shopify-embedded'],

  shopifyEmbedded: {
    apiKey: process.env.SHOPIFY_API_KEY,
    apiSecret: process.env.SHOPIFY_API_SECRET,
    appUrl: process.env.SHOPIFY_APP_URL,
    scopes: process.env.SHOPIFY_APP_SCOPES,
  },
})

3. Set up environment variables

# .env
SHOPIFY_API_KEY=your-api-key
SHOPIFY_API_SECRET=your-api-secret
SHOPIFY_APP_URL=https://your-app.com
SHOPIFY_APP_SCOPES=read_products,write_products

That's it! You can now use Shopify utilities in your app ✨

Usage

Server Composables

useShopifyAPI()

Returns the singleton Shopify API instance. Used for session token decoding, token exchange, and other API operations.

const shopify = useShopifyAPI()

// Decode a session token
const decoded = await shopify.session.decodeSessionToken(token)

// Exchange for offline access token
const response = await shopify.auth.tokenExchange({ shop, sessionToken, requestedTokenType })

useShopifyGraphQL(shop, accessToken)

Creates a GraphQL client for a specific shop. Returns a Shopify GraphqlClient instance.

// server/api/products.get.ts
export default defineEventHandler(async (event) => {
  const { shop, accessToken } = event.context.session

  const graphql = useShopifyGraphQL(shop.domain, accessToken)

  const result = await graphql.request(`
    query GetProducts($first: Int!) {
      products(first: $first) {
        edges {
          node { id, title }
        }
      }
    }
  `, { variables: { first: 10 } })

  return result.data
})

Polaris Components

Use Shopify Polaris components directly in your Vue templates with the s- prefix:

<template>
  <s-page title="Dashboard">
    <s-layout>
      <s-layout-section>
        <s-card>
          <s-text as="h2" variant="headingMd">Welcome to your app</s-text>
          <s-button @click="handleClick">Click me</s-button>
        </s-card>
      </s-layout-section>
    </s-layout>
  </s-page>
</template>

App Bridge

App Bridge is automatically loaded. Access it via window.shopify:

// In your Vue component
const toast = window.shopify.toast.show('Product saved!')

// Navigate using App Bridge
window.shopify.navigate('/products')

Runtime Config

Access Shopify configuration in your app:

// Client-side (public values only)
const config = useRuntimeConfig()
console.log(config.public.shopifyEmbedded.apiKey)
console.log(config.public.shopifyEmbedded.appUrl)

// Server-side (all values including secrets)
const config = useRuntimeConfig()
console.log(config.shopifyEmbedded.apiSecret)

Configuration

| Option | Type | Required | Description | |--------|------|----------|-------------| | apiKey | string | ✅ | Your Shopify app's API key | | apiSecret | string | ✅ | Your Shopify app's API secret | | appUrl | string | ✅ | Your app's public URL | | scopes | string | ✅ | Comma-separated OAuth scopes |

TypeScript

This module provides full TypeScript support including:

  • Module options autocomplete
  • Runtime config types
  • Global Window types for window.shopify (App Bridge) and window.Polaris
  • GraphQL client response types

Comparison with Alternatives

| Feature | nuxt-shopify-embedded | Shopifast (React) | |---------|----------------------|-------------------| | Framework | Nuxt / Vue 3 | Remix / React | | Server Runtime | Nitro | Remix | | Component Library | Polaris Web Components | Polaris React | | Deployment | Any (Vercel, Cloudflare, etc.) | Vercel | | Open Source | ✅ MIT License | Paid |

Development

# Install dependencies
pnpm install

# Prepare the module
pnpm dev:prepare

# Start the playground
pnpm dev

# Start with Shopify CLI (for OAuth testing)
pnpm dev:shopify

# Run tests
pnpm test

# Lint
pnpm lint

# Type check
pnpm test:types

Running the playground with Shopify CLI

The playground is a working Shopify embedded app. To run it against a real Shopify store, you need the Shopify CLI installed globally:

npm install -g @shopify/cli @shopify/theme

Then link your Shopify app configuration to the project:

shopify app config link

This creates the required .toml configuration files at the root of the project. Once linked, start the playground with:

pnpm dev:shopify

This runs shopify app dev inside the playground directory, which handles the OAuth tunnel and embeds your app in the Shopify admin.

Contributing

Contributions are welcome! Please read our contributing guidelines before submitting a PR.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

MIT License


Made with ❤️ for the Nuxt & Shopify community