TypeScript SDK
TypeScript SDK
ESM package @meridianads/sdk for browser and Node. This stub will mirror sdks/typescript/README.md.
Install
First slice uses GitLab Package Registry, not public npm. Configure the @meridianads scope against git.yelle.software, then:
npm
npm install @meridianads/sdk
# GitLab npm registry for yelle/saas/meridian-ads
# This page will match sdks/typescript/README.md when published.Serve, render, click
HMAC, timestamps, and the canonical string are handled by the client. Local origin: http://localhost:8090. Set sandbox: true with a mk_test_ key.
TypeScript
import { MeridianAds } from '@meridianads/sdk'
const client = new MeridianAds({
appKey: process.env.MERIDIAN_ADS_APP_KEY,
secret: process.env.MERIDIAN_ADS_SECRET,
// baseUrl: 'http://localhost:8090'
})
const decision = await client.serve('home', 'user-42', { country: 'US', plan: 'pro' })
if (!decision) {
// HTTP 204: no paid or house fill
} else {
await client.recordImpression(decision)
}Next
Read the HMAC contract if you call HTTP without the SDK, identifiers for context shape, and clicks for 302 plus impression order.