Installation
To get started with the Trackify SDK, follow these steps to install and configure it in your project.
1. Install the SDK
You can install the Trackify SDK from npm:
npm install trackify-sdk
# or
yarn add trackify-sdk2. Import and Initialize the Client
Import the createClient function from the SDK and initialize it with your Trackify API key and API URL:
import { createClient } from "trackify-sdk";
const client = createClient(
"YOUR_TRACKIFY_API_KEY", // Replace with your API key
"https://api.trackify.dev" // Replace with your Trackify API URL
);
3. Usage Examples
List All Apps
const apps = await client.listApps();
Create a New App
const app = await client.createApp("my.new.app");
Get a Link API Instance for an App
// Use linkApi to manage links for this app
const linkApi = await client.from("Your App Name");
List All Links for an App
const links = await linkApi.getLinks();
Create a New Link
const createdLink = await linkApi.createLink({
original: "https://www.example.com/",
description: "Example description",
});
Update a Link
const updatedLink = await linkApi.updateLink("your-link-id", {
originalUrl: "https://www.updated-url.com/",
description: "Updated description",
});
Delete a Link
const deleteLink = await linkApi.deleteLink("your-link-id");
💡 Tip:
For security, never expose your API key in client-side code. Use the SDK in server-side or backend environments.
Next Steps
- -See the Getting Started guide for a quick walkthrough.
- -Make sure you have your Trackify API key and URL from your dashboard.
Webhooks
How to integrate Trackify webhooks to your app