New:Microsoft Teams Notifications Are Now Available in Socket.Learn more →
Get Started

multipass-everywhere

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

multipass-everywhere

Shopify Multipass authentication library with WebCrypto API. WinterTC compatible - works in all JavaScript runtimes (Node.js, Deno, Cloudflare Workers, browsers) using standard Web APIs.

latest
Source
npmnpm
Version
1.0.2
Version published
Weekly downloads
13
44.44%
Maintainers
1
Weekly downloads
 
Created
Source

Multipass

A secure token generation library for Shopify Multipass authentication. WinterTC compatible - works across all JavaScript runtimes including Cloudflare Workers, Deno, Node.js, and browsers.

Shopify provides a mechanism for single sign-on known as Multipass. Multipass uses an AES encrypted JSON hash to securely pass customer information to Shopify and automatically log users in. This library provides functions for generating these tokens using standard Web APIs.

Lightweight and dependency-free - uses only native Web Crypto APIs for all cryptographic operations.

Installation

npm install multipass-everywhere

Usage

import { Multipass } from "multipass-everywhere";

// Initialize with your Shopify Multipass secret
// The secret can be found in your shop Admin (Settings > Checkout > Customer Accounts)
const multipass = new Multipass("your-multipass-secret");

// Create your customer data hash
// The email and created_at fields are required
const data = {
  email: "user@example.com",
  first_name: "John",
  last_name: "Smith",
  tag_string: "vip",
  return_to: "https://your-shop.myshopify.com/products/some-product",
};

// Encode data to a token
const token = await multipass.encode(data);
console.log(token);

// Generate a full Shopify login URL
const url = await multipass.generateUrl(data, "your-shop.myshopify.com");
console.log(url);
// Generates: https://your-shop.myshopify.com/account/login/multipass/{TOKEN}

Note: The library automatically adds the required created_at timestamp field.

Requirements

To use Multipass with Shopify, an Enterprise / Plus plan is required. Make sure "Accounts are required" or "Accounts are optional" is selected and Multipass is enabled in your Shopify admin.

Supported Customer Data Fields

You can include the following fields in your customer data:

FieldDescription
emailRequired. Customer's email address
created_atRequired. Current timestamp in ISO8601 format (added automatically)
first_nameCustomer's first name
last_nameCustomer's last name
tag_stringComma-separated tags to apply to the customer
return_toURL path within your store to redirect after login
identifierOptional unique identifier if emails aren't unique
addressesArray of customer addresses

Note: The remote_ip field is deprecated and no longer supported by Shopify.

Token Validity

Multipass tokens are only valid for 15 minutes and can only be used once. You should always generate tokens on-the-fly when needed.

Features

  • Secure encryption using AES-CBC
  • Token signing with HMAC
  • Base64URL encoding for URL safety
  • Works in browser and Node.js environments with Web Crypto API
  • WinterTC compatible - uses standard Web APIs for cross-runtime compatibility
  • Works in serverless environments like Cloudflare Workers
  • Zero dependencies - small bundle size and fast loading
  • Lightweight implementation using only native Web APIs

Author

Vadym Rusin

License

MIT

Keywords

multipass

FAQs

Package last updated on 20 May 2025

Related posts