Skip to main content

JavaScript SDK

Install from npm:

npm install scrift-sdk

Package: npmjs.com/package/scrift-sdk

The client ships with zero runtime dependencies beyond the platform.

Quick example

import { Scrift } from 'scrift-sdk'

const client = new Scrift({ apiKey: 'YOUR_API_KEY' })

// Get a brand
const brand = await client.catalog.get('stripe')
console.log(brand.name) // Stripe
console.log(brand.brandColor) // #635BFF
console.log(brand.darkModeColor)

// List brands
const result = await client.catalog.list({ limit: 20 })

// Search
const results = await client.catalog.search({ q: 'github' })

// Batch lookup
const batch = await client.catalog.batch({ slugs: ['stripe', 'github', 'vercel'] })

Source: github.com/phazeo/scrift-js