@sunboard/node 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +98 -0
- package/dist/index.d.mts +74 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +78 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +40 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 sunboardhq.com
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# @sunboard/node
|
|
2
|
+
|
|
3
|
+
Server-side SDK for [Sunboard](https://sunboardhq.com). Report billing and
|
|
4
|
+
backend product events so your Sunboard analytics can connect revenue and
|
|
5
|
+
retention to onboarding.
|
|
6
|
+
|
|
7
|
+
Run it on your server with a secret key. The browser SDK
|
|
8
|
+
([`@sunboard/react`](https://www.npmjs.com/package/@sunboard/react)) keeps using
|
|
9
|
+
your publishable key.
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm i @sunboard/node
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Requires Node.js 18 or later.
|
|
18
|
+
|
|
19
|
+
## Quick start
|
|
20
|
+
|
|
21
|
+
Create a secret key in your project dashboard (Settings → Secret key) and read it
|
|
22
|
+
from a server-side environment variable.
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
import { Sunboard } from "@sunboard/node";
|
|
26
|
+
|
|
27
|
+
const sunboard = new Sunboard({ secretKey: process.env.SUNBOARD_SECRET_KEY! });
|
|
28
|
+
|
|
29
|
+
// A trial converts to paid. Amounts are whole numbers in the smallest
|
|
30
|
+
// currency unit (cents for USD).
|
|
31
|
+
await sunboard.revenue({
|
|
32
|
+
userId: user.id,
|
|
33
|
+
amount: 4900,
|
|
34
|
+
currency: "usd",
|
|
35
|
+
idempotencyKey: invoice.id,
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
// A customer cancels.
|
|
39
|
+
await sunboard.churn({ userId: user.id });
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Always pass the **same `userId`** you give the browser SDK so events line up with
|
|
43
|
+
the right user's onboarding.
|
|
44
|
+
|
|
45
|
+
## API
|
|
46
|
+
|
|
47
|
+
### `revenue(input)`
|
|
48
|
+
|
|
49
|
+
Record money coming in.
|
|
50
|
+
|
|
51
|
+
| Field | Type | Notes |
|
|
52
|
+
| --- | --- | --- |
|
|
53
|
+
| `userId` | `string` | Required. Same id as the browser SDK. |
|
|
54
|
+
| `amount` | `number` | Required. Whole number in the smallest currency unit. Negative for refunds. |
|
|
55
|
+
| `currency` | `string` | Required. ISO code, e.g. `"usd"`. |
|
|
56
|
+
| `type` | `"conversion" \| "renewal" \| "expansion" \| "refund"` | Defaults to `"conversion"`. |
|
|
57
|
+
| `idempotencyKey` | `string` | Optional, recommended (see [Retries](#retries)). |
|
|
58
|
+
| `occurredAt` | `Date \| string` | Optional. When it happened; defaults to now. |
|
|
59
|
+
| `externalId` | `string` | Optional. Your own order or charge id. |
|
|
60
|
+
|
|
61
|
+
```ts
|
|
62
|
+
await sunboard.revenue({ userId, amount: 4900, currency: "usd", type: "renewal" });
|
|
63
|
+
await sunboard.revenue({ userId, amount: -4900, currency: "usd", type: "refund" });
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### `churn(input)`
|
|
67
|
+
|
|
68
|
+
Record a customer cancelling or lapsing. Takes a `userId` (and the same optional
|
|
69
|
+
fields as above, minus `amount`/`currency`).
|
|
70
|
+
|
|
71
|
+
```ts
|
|
72
|
+
await sunboard.churn({ userId: user.id });
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### `track(input)`
|
|
76
|
+
|
|
77
|
+
Record a product event from your backend — handy when the action that proves
|
|
78
|
+
value happens on your server. Omit `experienceKey` to advance any onboarding
|
|
79
|
+
checklist listening for the event, or pass one to scope it to a single
|
|
80
|
+
experience.
|
|
81
|
+
|
|
82
|
+
```ts
|
|
83
|
+
await sunboard.track({ userId: user.id, eventName: "workflow_published" });
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Retries
|
|
87
|
+
|
|
88
|
+
Backends retry. Pass an `idempotencyKey` (your invoice or charge id works well)
|
|
89
|
+
and sending the same event twice is ignored instead of counted twice. The
|
|
90
|
+
response's `deduplicated` flag tells you which happened.
|
|
91
|
+
|
|
92
|
+
## Documentation
|
|
93
|
+
|
|
94
|
+
Full guide: <https://sunboardhq.com/docs/revenue>
|
|
95
|
+
|
|
96
|
+
## License
|
|
97
|
+
|
|
98
|
+
MIT. See [LICENSE](./LICENSE).
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { BillingEventType, BillingEventType as BillingEventType$1, RuntimeBillingResponse, RuntimeBillingResponse as RuntimeBillingResponse$1, RuntimeTrackResponse, RuntimeTrackResponse as RuntimeTrackResponse$1, SunboardRuntimeApiError } from "@sunboard/core/runtime-api";
|
|
2
|
+
|
|
3
|
+
//#region src/index.d.ts
|
|
4
|
+
type SunboardOptions = {
|
|
5
|
+
/** A secret key (`sk_live_…` / `sk_test_…`) from the project dashboard. */
|
|
6
|
+
secretKey: string;
|
|
7
|
+
/** Dev-only override of the runtime API host. Defaults to the hosted API. */
|
|
8
|
+
apiUrl?: string;
|
|
9
|
+
/** Override the fetch implementation (e.g. for testing). */
|
|
10
|
+
fetch?: typeof fetch;
|
|
11
|
+
};
|
|
12
|
+
/** Billing types that carry money. `churn` is recorded via {@link Sunboard.churn}. */
|
|
13
|
+
type RevenueType = Exclude<BillingEventType$1, "churn">;
|
|
14
|
+
type CommonBillingInput = {
|
|
15
|
+
/** The same user id your app sends to the client SDK. */
|
|
16
|
+
userId: string;
|
|
17
|
+
/** Optional, enriches the user record if it does not exist yet. */
|
|
18
|
+
email?: string | null;
|
|
19
|
+
/** When the billing moment happened. Defaults to now. */
|
|
20
|
+
occurredAt?: Date | string;
|
|
21
|
+
/** Strongly recommended: makes retries safe (no double counting). */
|
|
22
|
+
idempotencyKey?: string;
|
|
23
|
+
/** Your own order/subscription id, for cross-reference. */
|
|
24
|
+
externalId?: string;
|
|
25
|
+
properties?: Record<string, unknown>;
|
|
26
|
+
};
|
|
27
|
+
type RevenueInput = CommonBillingInput & {
|
|
28
|
+
/** Minor units (e.g. cents). Negative for a refund. */
|
|
29
|
+
amount: number;
|
|
30
|
+
/** ISO 4217 currency, e.g. "usd". */
|
|
31
|
+
currency: string;
|
|
32
|
+
/** Defaults to "conversion" (trial converted to paid). */
|
|
33
|
+
type?: RevenueType;
|
|
34
|
+
};
|
|
35
|
+
type ChurnInput = CommonBillingInput;
|
|
36
|
+
type TrackInput = {
|
|
37
|
+
/** The same user id your app sends to the client SDK. */
|
|
38
|
+
userId: string;
|
|
39
|
+
/** Optional, enriches the user record if it does not exist yet. */
|
|
40
|
+
email?: string | null;
|
|
41
|
+
eventName: string;
|
|
42
|
+
/**
|
|
43
|
+
* Scope the event to one experience. Omit to fan the event out to every
|
|
44
|
+
* active experience whose checklist listens for it (usually what a backend
|
|
45
|
+
* wants, since it does not know which experience is on screen).
|
|
46
|
+
*/
|
|
47
|
+
experienceKey?: string;
|
|
48
|
+
properties?: Record<string, unknown>;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Server-side Sunboard client. Authenticated with a secret key, it records
|
|
52
|
+
* billing-lifecycle events (revenue, churn) from your backend, where your
|
|
53
|
+
* billing already lives. Never instantiate this in the browser — the secret key
|
|
54
|
+
* must stay server-side.
|
|
55
|
+
*/
|
|
56
|
+
declare class Sunboard {
|
|
57
|
+
private readonly client;
|
|
58
|
+
constructor(options: SunboardOptions);
|
|
59
|
+
/**
|
|
60
|
+
* Record money received: a trial converting, a renewal, expansion, or a
|
|
61
|
+
* refund (pass a negative `amount` with `type: "refund"`).
|
|
62
|
+
*/
|
|
63
|
+
revenue(input: RevenueInput): Promise<RuntimeBillingResponse$1>;
|
|
64
|
+
/** Record a customer churning (subscription cancelled or lapsed). */
|
|
65
|
+
churn(input: ChurnInput): Promise<RuntimeBillingResponse$1>;
|
|
66
|
+
/**
|
|
67
|
+
* Record an activation event from your backend. Omit `experienceKey` to let
|
|
68
|
+
* it advance any onboarding checklist listening for `eventName`.
|
|
69
|
+
*/
|
|
70
|
+
track(input: TrackInput): Promise<RuntimeTrackResponse$1>;
|
|
71
|
+
}
|
|
72
|
+
//#endregion
|
|
73
|
+
export { type BillingEventType, ChurnInput, RevenueInput, RevenueType, type RuntimeBillingResponse, type RuntimeTrackResponse, Sunboard, SunboardOptions, SunboardRuntimeApiError, TrackInput };
|
|
74
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;KAiBY,eAAA;EAAA;EAUA,SAAA,EAAA,MAAW;EAElB;EAcO,MAAA,CAAA,EAAA,MAAY;EAWZ;EAEA,KAAA,CAAA,EAAA,OAjCK,KAiCK;AAqBtB,CAAA;;AAwBiB,KA1EL,WAAA,GAAc,OA0ET,CA1EiB,kBA0EjB,EAAA,OAAA,CAAA;KAxEZ,kBAAA,GAwEmC;EAAR;EAcjB,MAAA,EAAA,MAAA;EAAqB;EAAR,KAAA,CAAA,EAAA,MAAA,GAAA,IAAA;EAeb;EAAqB,UAAA,CAAA,EA/FrB,IA+FqB,GAAA,MAAA;EAAR;EAAO,cAAA,CAAA,EAAA,MAAA;;;eA1FpB;;KAGH,YAAA,GAAe;;;;;;SAMlB;;KAKG,UAAA,GAAa;KAEb,UAAA;;;;;;;;;;;;eAYG;;;;;;;;cASF,QAAA;;uBAGU;;;;;iBAqBN,eAAe,QAAQ;;eAczB,aAAa,QAAQ;;;;;eAerB,aAAa,QAAQ"}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { DEFAULT_RUNTIME_API_URL, SunboardRuntimeApiError, SunboardRuntimeClient } from "@sunboard/core/runtime-api";
|
|
2
|
+
|
|
3
|
+
//#region src/index.ts
|
|
4
|
+
const SECRET_KEY_PREFIX = "sk_";
|
|
5
|
+
/**
|
|
6
|
+
* Server-side Sunboard client. Authenticated with a secret key, it records
|
|
7
|
+
* billing-lifecycle events (revenue, churn) from your backend, where your
|
|
8
|
+
* billing already lives. Never instantiate this in the browser — the secret key
|
|
9
|
+
* must stay server-side.
|
|
10
|
+
*/
|
|
11
|
+
var Sunboard = class {
|
|
12
|
+
client;
|
|
13
|
+
constructor(options) {
|
|
14
|
+
if (!options.secretKey) throw new Error("Sunboard requires a `secretKey`.");
|
|
15
|
+
if (!options.secretKey.startsWith(SECRET_KEY_PREFIX)) throw new Error("Sunboard requires a secret key (sk_…). Publishable keys (pk_…) cannot record billing events.");
|
|
16
|
+
this.client = new SunboardRuntimeClient({
|
|
17
|
+
apiKey: options.secretKey,
|
|
18
|
+
apiUrl: options.apiUrl ?? DEFAULT_RUNTIME_API_URL,
|
|
19
|
+
fetch: options.fetch
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Record money received: a trial converting, a renewal, expansion, or a
|
|
24
|
+
* refund (pass a negative `amount` with `type: "refund"`).
|
|
25
|
+
*/
|
|
26
|
+
revenue(input) {
|
|
27
|
+
return this.client.recordBilling({
|
|
28
|
+
amount: input.amount,
|
|
29
|
+
currency: input.currency,
|
|
30
|
+
externalId: input.externalId,
|
|
31
|
+
idempotencyKey: input.idempotencyKey,
|
|
32
|
+
occurredAt: toIso(input.occurredAt),
|
|
33
|
+
properties: input.properties,
|
|
34
|
+
type: input.type ?? "conversion",
|
|
35
|
+
user: {
|
|
36
|
+
email: input.email,
|
|
37
|
+
id: input.userId
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
/** Record a customer churning (subscription cancelled or lapsed). */
|
|
42
|
+
churn(input) {
|
|
43
|
+
return this.client.recordBilling({
|
|
44
|
+
externalId: input.externalId,
|
|
45
|
+
idempotencyKey: input.idempotencyKey,
|
|
46
|
+
occurredAt: toIso(input.occurredAt),
|
|
47
|
+
properties: input.properties,
|
|
48
|
+
type: "churn",
|
|
49
|
+
user: {
|
|
50
|
+
email: input.email,
|
|
51
|
+
id: input.userId
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Record an activation event from your backend. Omit `experienceKey` to let
|
|
57
|
+
* it advance any onboarding checklist listening for `eventName`.
|
|
58
|
+
*/
|
|
59
|
+
track(input) {
|
|
60
|
+
return this.client.track({
|
|
61
|
+
eventName: input.eventName,
|
|
62
|
+
experienceKey: input.experienceKey,
|
|
63
|
+
properties: input.properties,
|
|
64
|
+
user: {
|
|
65
|
+
email: input.email,
|
|
66
|
+
id: input.userId
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
function toIso(value) {
|
|
72
|
+
if (value === void 0) return;
|
|
73
|
+
return typeof value === "string" ? value : value.toISOString();
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
//#endregion
|
|
77
|
+
export { Sunboard, SunboardRuntimeApiError };
|
|
78
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import {\n DEFAULT_RUNTIME_API_URL,\n SunboardRuntimeClient,\n type BillingEventType,\n type RuntimeBillingResponse,\n type RuntimeTrackResponse\n} from \"@sunboard/core/runtime-api\";\n\nexport {\n SunboardRuntimeApiError,\n type BillingEventType,\n type RuntimeBillingResponse,\n type RuntimeTrackResponse\n} from \"@sunboard/core/runtime-api\";\n\nconst SECRET_KEY_PREFIX = \"sk_\";\n\nexport type SunboardOptions = {\n /** A secret key (`sk_live_…` / `sk_test_…`) from the project dashboard. */\n secretKey: string;\n /** Dev-only override of the runtime API host. Defaults to the hosted API. */\n apiUrl?: string;\n /** Override the fetch implementation (e.g. for testing). */\n fetch?: typeof fetch;\n};\n\n/** Billing types that carry money. `churn` is recorded via {@link Sunboard.churn}. */\nexport type RevenueType = Exclude<BillingEventType, \"churn\">;\n\ntype CommonBillingInput = {\n /** The same user id your app sends to the client SDK. */\n userId: string;\n /** Optional, enriches the user record if it does not exist yet. */\n email?: string | null;\n /** When the billing moment happened. Defaults to now. */\n occurredAt?: Date | string;\n /** Strongly recommended: makes retries safe (no double counting). */\n idempotencyKey?: string;\n /** Your own order/subscription id, for cross-reference. */\n externalId?: string;\n properties?: Record<string, unknown>;\n};\n\nexport type RevenueInput = CommonBillingInput & {\n /** Minor units (e.g. cents). Negative for a refund. */\n amount: number;\n /** ISO 4217 currency, e.g. \"usd\". */\n currency: string;\n /** Defaults to \"conversion\" (trial converted to paid). */\n type?: RevenueType;\n};\n\n// Churn is a state marker that bounds a customer's lifetime; it carries no money\n// figure. We deliberately do not track MRR — that lives in the billing system.\nexport type ChurnInput = CommonBillingInput;\n\nexport type TrackInput = {\n /** The same user id your app sends to the client SDK. */\n userId: string;\n /** Optional, enriches the user record if it does not exist yet. */\n email?: string | null;\n eventName: string;\n /**\n * Scope the event to one experience. Omit to fan the event out to every\n * active experience whose checklist listens for it (usually what a backend\n * wants, since it does not know which experience is on screen).\n */\n experienceKey?: string;\n properties?: Record<string, unknown>;\n};\n\n/**\n * Server-side Sunboard client. Authenticated with a secret key, it records\n * billing-lifecycle events (revenue, churn) from your backend, where your\n * billing already lives. Never instantiate this in the browser — the secret key\n * must stay server-side.\n */\nexport class Sunboard {\n private readonly client: SunboardRuntimeClient;\n\n constructor(options: SunboardOptions) {\n if (!options.secretKey) {\n throw new Error(\"Sunboard requires a `secretKey`.\");\n }\n if (!options.secretKey.startsWith(SECRET_KEY_PREFIX)) {\n throw new Error(\n \"Sunboard requires a secret key (sk_…). Publishable keys (pk_…) cannot record billing events.\"\n );\n }\n\n this.client = new SunboardRuntimeClient({\n apiKey: options.secretKey,\n apiUrl: options.apiUrl ?? DEFAULT_RUNTIME_API_URL,\n fetch: options.fetch\n });\n }\n\n /**\n * Record money received: a trial converting, a renewal, expansion, or a\n * refund (pass a negative `amount` with `type: \"refund\"`).\n */\n revenue(input: RevenueInput): Promise<RuntimeBillingResponse> {\n return this.client.recordBilling({\n amount: input.amount,\n currency: input.currency,\n externalId: input.externalId,\n idempotencyKey: input.idempotencyKey,\n occurredAt: toIso(input.occurredAt),\n properties: input.properties,\n type: input.type ?? \"conversion\",\n user: { email: input.email, id: input.userId }\n });\n }\n\n /** Record a customer churning (subscription cancelled or lapsed). */\n churn(input: ChurnInput): Promise<RuntimeBillingResponse> {\n return this.client.recordBilling({\n externalId: input.externalId,\n idempotencyKey: input.idempotencyKey,\n occurredAt: toIso(input.occurredAt),\n properties: input.properties,\n type: \"churn\",\n user: { email: input.email, id: input.userId }\n });\n }\n\n /**\n * Record an activation event from your backend. Omit `experienceKey` to let\n * it advance any onboarding checklist listening for `eventName`.\n */\n track(input: TrackInput): Promise<RuntimeTrackResponse> {\n return this.client.track({\n eventName: input.eventName,\n experienceKey: input.experienceKey,\n properties: input.properties,\n user: { email: input.email, id: input.userId }\n });\n }\n}\n\nfunction toIso(value: Date | string | undefined): string | undefined {\n if (value === undefined) {\n return undefined;\n }\n return typeof value === \"string\" ? value : value.toISOString();\n}\n"],"mappings":";;;AAeA,MAAM,oBAAoB;;;;;;;AA8D1B,IAAa,WAAb,MAAsB;CACpB,AAAiB;CAEjB,YAAY,SAA0B;AACpC,MAAI,CAAC,QAAQ,UACX,OAAM,IAAI,MAAM,mCAAmC;AAErD,MAAI,CAAC,QAAQ,UAAU,WAAW,kBAAkB,CAClD,OAAM,IAAI,MACR,+FACD;AAGH,OAAK,SAAS,IAAI,sBAAsB;GACtC,QAAQ,QAAQ;GAChB,QAAQ,QAAQ,UAAU;GAC1B,OAAO,QAAQ;GAChB,CAAC;;;;;;CAOJ,QAAQ,OAAsD;AAC5D,SAAO,KAAK,OAAO,cAAc;GAC/B,QAAQ,MAAM;GACd,UAAU,MAAM;GAChB,YAAY,MAAM;GAClB,gBAAgB,MAAM;GACtB,YAAY,MAAM,MAAM,WAAW;GACnC,YAAY,MAAM;GAClB,MAAM,MAAM,QAAQ;GACpB,MAAM;IAAE,OAAO,MAAM;IAAO,IAAI,MAAM;IAAQ;GAC/C,CAAC;;;CAIJ,MAAM,OAAoD;AACxD,SAAO,KAAK,OAAO,cAAc;GAC/B,YAAY,MAAM;GAClB,gBAAgB,MAAM;GACtB,YAAY,MAAM,MAAM,WAAW;GACnC,YAAY,MAAM;GAClB,MAAM;GACN,MAAM;IAAE,OAAO,MAAM;IAAO,IAAI,MAAM;IAAQ;GAC/C,CAAC;;;;;;CAOJ,MAAM,OAAkD;AACtD,SAAO,KAAK,OAAO,MAAM;GACvB,WAAW,MAAM;GACjB,eAAe,MAAM;GACrB,YAAY,MAAM;GAClB,MAAM;IAAE,OAAO,MAAM;IAAO,IAAI,MAAM;IAAQ;GAC/C,CAAC;;;AAIN,SAAS,MAAM,OAAsD;AACnE,KAAI,UAAU,OACZ;AAEF,QAAO,OAAO,UAAU,WAAW,QAAQ,MAAM,aAAa"}
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sunboard/node",
|
|
3
|
+
"version": "0.4.0",
|
|
4
|
+
"description": "Server-side SDK for Sunboard. Records revenue, churn, and server-side events with a secret key.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"homepage": "https://sunboardhq.com",
|
|
8
|
+
"publishConfig": {
|
|
9
|
+
"access": "public"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"dist",
|
|
13
|
+
"README.md",
|
|
14
|
+
"LICENSE"
|
|
15
|
+
],
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./dist/index.d.mts",
|
|
19
|
+
"import": "./dist/index.mjs"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@sunboard/core": "0.4.0"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@types/node": "^22.19.3",
|
|
27
|
+
"eslint": "^9.39.1",
|
|
28
|
+
"tsdown": "^0.16.7",
|
|
29
|
+
"typescript": "5.9.2",
|
|
30
|
+
"vitest": "^4.0.15",
|
|
31
|
+
"@repo/eslint-config": "0.0.0",
|
|
32
|
+
"@repo/typescript-config": "0.0.0"
|
|
33
|
+
},
|
|
34
|
+
"scripts": {
|
|
35
|
+
"build": "tsdown",
|
|
36
|
+
"check-types": "tsc --noEmit",
|
|
37
|
+
"lint": "eslint .",
|
|
38
|
+
"test": "vitest run"
|
|
39
|
+
}
|
|
40
|
+
}
|