
Security News
White House Authorizes Private Companies to Conduct Offensive Cyber Operations
A new federal program will let vetted U.S. cybersecurity firms help investigate and disrupt foreign cybercrime groups under government direction.
@cross-deck/node
Advanced tools
Crossdeck server SDK for Node.js — secret-key access to entitlements, identity, telemetry, purchases, and audit reads.
The Crossdeck server SDK for Node.js.
This is the secret-key SDK: server-only, no browser assumptions, no auto-tracking, no local state. It wraps the real HTTP surface for entitlements, identity aliasing, event ingest, purchase forwarding, manual entitlement overrides, and audit reads.
npm install @cross-deck/node
import { CrossdeckServer } from "@cross-deck/node";
const crossdeck = new CrossdeckServer({
secretKey: process.env.CROSSDECK_SECRET_KEY!,
});
const entitlements = await crossdeck.getEntitlements({ userId: "user_847" });
await crossdeck.track({
name: "invoice.retry_started",
developerUserId: "user_847",
properties: { invoiceId: "inv_123" },
});
customerId, userId, or anonymousId.anonymousId to your stable userId.import { CrossdeckServer } from "@cross-deck/node";
const crossdeck = new CrossdeckServer({
secretKey: process.env.CROSSDECK_SECRET_KEY!,
baseUrl: "https://api.cross-deck.com/v1", // optional
timeoutMs: 15_000, // optional
appId: "app_web_xxx", // optional informational event envelope field
});
secretKey must start with cd_sk_. The constructor throws immediately on
an invalid key prefix so a server misconfiguration fails at boot, not under
load.
await crossdeck.identify(userId, anonymousId, options?)Alias a pre-login anonymousId to your stable user ID. This is the same
identity graph the web SDK uses, just called explicitly from your backend.
await crossdeck.identify("user_847", "anon_123", {
email: "wes@example.com",
traits: { plan: "pro", region: "za" },
});
identify() is a convenience alias for aliasIdentity(...).
Traits are sanitised before send with the same rules as @cross-deck/web:
BigInt becomes a string, circular refs become "[circular]", Map/Set
normalise to JSON-friendly shapes, and functions/symbols/undefined are dropped.
await crossdeck.forget(hints)Queue GDPR/CCPA deletion by customerId, userId, or anonymousId.
await crossdeck.forget({ customerId: "cdcust_123" });
await crossdeck.getEntitlements(hints)Read entitlements by any supported identity hint.
const result = await crossdeck.getEntitlements({ userId: "user_847" });
console.log(result.data.map((e) => e.key));
await crossdeck.getCustomerEntitlements(customerId)Server-only direct lookup by canonical Crossdeck customer ID.
const result = await crossdeck.getCustomerEntitlements("cdcust_123");
await crossdeck.grantEntitlement(input)Manually grant an entitlement.
await crossdeck.grantEntitlement({
customerId: "cdcust_123",
entitlementKey: "pro",
duration: "P30D",
reason: "Support recovery after billing incident",
});
await crossdeck.revokeEntitlement(input)Manually revoke an entitlement.
await crossdeck.revokeEntitlement({
customerId: "cdcust_123",
entitlementKey: "pro",
reason: "Chargeback",
});
await crossdeck.track(event)Send one event immediately.
await crossdeck.track({
name: "support.refund_issued",
crossdeckCustomerId: "cdcust_123",
properties: { ticketId: "ticket_987" },
});
Identity is required on every event. Provide at least one of:
developerUserIdanonymousIdcrossdeckCustomerIdawait crossdeck.ingest(events)Send a batch in one call.
await crossdeck.ingest([
{
name: "job.started",
developerUserId: "user_847",
properties: { job: "daily-mrr-reconcile" },
},
{
name: "job.completed",
developerUserId: "user_847",
properties: { job: "daily-mrr-reconcile", durationMs: 842 },
},
]);
The SDK auto-mints eventId and timestamp if you omit them.
Event properties are sanitised with the same contract as the web SDK before
they hit the wire, so one bad backend-shaped object cannot crash request
serialization.
await crossdeck.syncPurchases(input)Forward Apple signed purchase evidence to Crossdeck.
await crossdeck.syncPurchases({
signedTransactionInfo: transactionJws,
signedRenewalInfo: renewalJws,
});
await crossdeck.getAuditEntry(eventId)Read one audit row by event ID.
const audit = await crossdeck.getAuditEntry("srv_grant_123");
console.log(audit.decision, audit.reason);
Every non-2xx response is normalised to CrossdeckError:
import { CrossdeckError } from "@cross-deck/node";
try {
await crossdeck.getEntitlements({ userId: "user_847" });
} catch (err) {
if (err instanceof CrossdeckError) {
console.error(err.type, err.code, err.requestId);
}
}
The error fields mirror the backend envelope:
typecodemessagerequestIdstatusretryAfterMsNode 18+ is required. The SDK uses the platform fetch implementation and
does not ship an HTTP dependency.
MIT
FAQs
Crossdeck server SDK for Node.js — verified subscriptions, entitlements, server-side error capture, and product telemetry in one client.
The npm package @cross-deck/node receives a total of 136 weekly downloads. As such, @cross-deck/node popularity was classified as not popular.
We found that @cross-deck/node demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
A new federal program will let vetted U.S. cybersecurity firms help investigate and disrupt foreign cybercrime groups under government direction.

Research
/Security News
The campaign amassed more than 75,000 installs by targeting Russian-speaking users seeking access to blocked services.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.