@li-nk.me/node-sdk
v0.2.13
Published
Official li-nk.me Node.js client for administering links via the Edge API.
Maintainers
Readme
LinkMe Node SDK
Official Node.js client for LinkMe — link management and webhook helpers.
- Main Site: li-nk.me
- Documentation: Node Setup
- Package: npm
Installation
npm install @li-nk.me/node-sdkBasic Usage
import LinkMeClient from '@li-nk.me/node-sdk';
const client = new LinkMeClient({
apiKey: 'YOUR_API_KEY',
});
const created = await client.createLink({ appId: 'app_123', slug: 'welcome', deepLink: '/welcome' });createLink supports displayInPortal:
falsehides the link from the Portal links list (still works as a universal link).trueshows it in the Portal.- In this SDK, if omitted, it defaults to
false.
CommonJS Usage
const LinkMeClient = require('@li-nk.me/node-sdk').default;
const client = new LinkMeClient({
apiKey: 'YOUR_API_KEY',
});Methods
| Method | Description |
| --- | --- |
| createLink(input) | Create a short link. Returns { id, app_id, domain_id, slug, slugUrl }. |
| getLink(id) | Fetch a link by slug or ID. |
| listLinks(appId) | List all links for an app with computed extras. |
| updateLink(id, updates) | Partial update using snake_case fields and 0 \| 1 flags. |
| deleteLink(id) | Permanently delete a link. |
Webhook Helpers
The SDK also exports helpers for common webhook receiver logic:
- verify
X-LinkMe-Signature - parse the LinkMe webhook envelope
import {
parseLinkMeWebhookEnvelope,
verifyLinkMeWebhookSignature,
} from '@li-nk.me/node-sdk';
const rawBody = req.rawBody.toString('utf8');
const signature = req.get('X-LinkMe-Signature');
if (!verifyLinkMeWebhookSignature(rawBody, signature, process.env.LINKME_WEBHOOK_SIGNING_SECRET!)) {
res.status(401).send('Invalid signature');
return;
}
const envelope = parseLinkMeWebhookEnvelope(JSON.parse(rawBody));Zod Schemas
The SDK exports Zod schemas and inferred types for runtime validation: LinkSchema, ExtendedLinkSchema, CreateLinkInputSchema, UpdateLinkInputSchema, CreateLinkResponseSchema, LinkMeWebhookEnvelopeSchema.
For full documentation, guides, and API reference, please visit our Help Center.
License
Apache-2.0
