oc · docs
documentation

@orangecheck/me-client


@orangecheck/me-client / session

Variable: session

const session: {
  create: (opts: SignInOptions) => Promise<Session>;
  invalidate: (sessionId: string) => Promise<void>;
  refresh: (sessionId: string) => Promise<Session>;
};

Defined in: me-client/src/session.ts:83

@orangecheck/me-client

Client for me.ochk.io. Verify orangecheck sign-in on your server, let in only backed accounts if you choose, and, while you pay your users, report the events that earn them sats.

Three entry points for three audiences:

import { ... } from '@orangecheck/me-client' // events, config, webhooks (no React) import { ... } from '@orangecheck/me-client/server' // server-side verification (Next.js, Express, Hono — all without env vars or JWK handling) import { signInWithOc } from '@orangecheck/me-client/popup' // browser-only popup orchestrator

Server-side verification example:

// pages/api/me.ts import { withOcAuth } from '@orangecheck/me-client/server';

export default withOcAuth(async (req, res) => { if (!req.ocSession) return res.status(401).json({ ok: false }); res.status(200).json({ address: req.ocSession.did_oc }); });

Popup signin example:

import { signInWithOc } from '@orangecheck/me-client/popup';

button.addEventListener('click', async () => { const result = await signInWithOc(); if (!result) return; // user cancelled localStorage.setItem('oc-token', result.token); location.assign('/dashboard'); });

Type Declaration

NameTypeDefined in
<a id="property-create"></a> create()(opts: SignInOptions) => Promise&lt;Session>me-client/src/session.ts:83
<a id="property-invalidate"></a> invalidate()(sessionId: string) => Promise&lt;void>me-client/src/session.ts:83
<a id="property-refresh"></a> refresh()(sessionId: string) => Promise&lt;Session>me-client/src/session.ts:83