Installation
npm / pnpm / yarn
# npm
npm install @tanqory/sdk @tanqory/types
# pnpm
pnpm add @tanqory/sdk @tanqory/types
# yarn
yarn add @tanqory/sdk @tanqory/types
Requirements
| Requirement | Version |
|---|---|
| Node.js | >= 18.0.0 |
| TypeScript | >= 5.0 (optional but recommended) |
Peer Dependencies
The SDK has zero required peer dependencies for server-side usage.
For React hooks, install TanStack Query:
npm install @tanstack/react-query
Package Contents
| Package | Purpose |
|---|---|
@tanqory/sdk | API client, error classes, webhook verification |
@tanqory/types | TypeScript types, Zod schemas, Tanqory namespace |
Verify Installation
import { createClient } from '@tanqory/sdk'
import type { Tanqory } from '@tanqory/types'
const tanqory = createClient({
apiKey: 'pk_live_your_key',
})
// Type-safe API calls
const stores: Tanqory.Store[] = await tanqory.stores.list()
console.log(`Found ${stores.length} stores`)
Environment Support
| Environment | Supported |
|---|---|
| Node.js (server) | Yes |
| Browser (client) | Yes |
| React Native | Yes |
| Edge Runtime (Vercel, Cloudflare) | Yes |
| Deno / Bun | Yes |
CDN (Browser)
For quick prototyping without a bundler:
<script src="https://cdn.tanqory.com/sdk/latest/tanqory.min.js"></script>
<script>
const tanqory = Tanqory.createClient({ apiKey: 'pk_live_...' })
</script>
Next Steps
- Client Setup -- configure the client
- Type Safety -- leverage the
Tanqorynamespace - React Hooks -- use hooks in React apps