Quickstarts
Embedded offerwall
Mount a signed offerwall inside your web experience.
Prepare your placement
Register an app or site in the publisher workspace, choose the integration method, then create a placement. Configure its reward currency and signed callback endpoint. Your account’s enabled integrations determine which methods you can activate.
Establish a scoped session
Exchange a short-lived publisher-server-signed JWS HS256 assertion and public SDK key through the offerwall session endpoint. The assertion binds issuer, audience KRIN, opaque user subject, app, placement, issued/expiry times and a unique nonce. Its lifetime is at most five minutes. Keep the signing secret on your server. The returned 15-minute token is scoped to one user, app and placement; a public SDK key or browser user ID cannot authenticate that user.
Mount an inline wall
Use the signed configuration from your authenticated backend. Reserve a height on the container before opening. Authorize the publisher origin in allowedOrigins and your deployment frame-ancestors policy. The SDK checks the wall origin, frame and per-open session. Supply all signed handoff fields shown in the Web quickstart.
TypeScript
import { init, type InitOptions } from "@krin/sdk-web";
export function mountRewards(config: InitOptions, container: HTMLElement) {
const wall = init(config);
const unsubscribe = wall.on("error", ({ code }) => {
container.setAttribute("data-reward-error", code);
});
wall.open({ container });
return () => {
unsubscribe();
wall.close();
wall.destroy();
};
}Verify the full reward journey
Run a publisher postback test, including duplicate and reversal handling. Check signature verification, the durable event record, callback delivery and your server’s acknowledgement separately. Record the user credit receipt after your own ledger commits. A transport response alone does not prove a user was credited.