Quickstart
Install the SDK, add your key, and render your first result. This guide uses Web; the same three steps apply on every platform.
1. Install
Add the Nosmai SDK to your project with your package manager of choice.
npm install @nosmai/web
2. Get your API key
Create an app in the dashboard and copy its key. Use a nsk_test_… key while developing and a nsk_live_… key in production.
WARNING
Never ship secret keys in your app binary. The mobile SDKs authenticate with an app ID; secret keys stay on the Nosmai edge. See Authentication for details.
3. Initialize the client
Create one client and reuse it across your app.
import { Nosmai } from "@nosmai/web"
const nosmai = new Nosmai("nsk_live_...")
4. Make your first call
Pick the product you enabled and call it. Each returns in real time.
// Effects: apply a filter to a camera stream
const cam = await nosmai.camera()
cam.use("aurora-glow").attach(videoEl).start()
// Moderation: check user content on-device
const r = await nosmai.moderate("is this text safe?")
TIP
That’s it, you’re live. Next, dive into the product guide for Effects or Moderation.