New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

capacitor-chottulink-sdk

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

capacitor-chottulink-sdk

ChottuLink is your all-in-one solution for creating, managing, and tracking dynamic links across platforms. Boost your marketing campaigns with smart deep linking and comprehensive analytics.

latest
npmnpm
Version
1.0.4
Version published
Maintainers
1
Created
Source

npm version License

ChottuLink is your all-in-one solution for creating, managing, and tracking dynamic links across platforms. Boost your marketing campaigns with smart deep linking and comprehensive analytics.

Features

  • 🔗 Dynamic Link Creation - Create short, trackable links with custom parameters
  • 📱 Deep Linking - Seamlessly route users to specific content in your app
  • 📊 Analytics - Track link performance with UTM parameters
  • 🎯 Platform-Specific Behavior - Control how links behave on iOS and Android
  • 🔔 Event Listeners - Listen for deep link resolution events
  • 🌐 Cross-Platform - Works on iOS, Android, and Web (with limitations)

Installation

npm install capacitor-chottulink-sdk
npx cap sync

Prerequisites

Before installing this plugin, ensure you have the following set up:

  • Node.js: 16.x or higher
  • Capacitor: 5.0.0 or higher
  • iOS Deployment Target: 15.0 or higher
  • Android SDK: API 21 (Android 5.0) or higher
  • ChottuLink Account: A valid ChottuLink account with an API key

Getting Started

1. Initialize the SDK

Before using any ChottuLink features, you must initialize the SDK with your API key:

import { ChottuLinkIonicSDK } from 'capacitor-chottulink-sdk';

await ChottuLinkIonicSDK.initialize({
    apiKey: 'your-api-key-here'
});

Create dynamic links with customizable parameters:

import { ChottuLinkIonicSDK, CLDynamicLinkBehaviour } from 'capacitor-chottulink-sdk';

const result = await ChottuLinkIonicSDK.createDynamicLink({
    builder: {
        destinationURL: 'https://example.com/product/123',
        domain: 'your-domain.com',
        linkName: 'product-link',
        iosBehaviour: CLDynamicLinkBehaviour.app,
        androidBehaviour: CLDynamicLinkBehaviour.app,
        socialTitle: 'Check out this product!',
        socialDescription: 'Amazing product description',
        socialImageUrl: 'https://example.com/image.jpg',
        utmSource: 'email',
        utmMedium: 'campaign',
        utmCampaign: 'summer-sale'
    }
});

console.log('Short URL:', result.shortURL);
// Listen for successful deep link resolution
ChottuLinkIonicSDK.addListener('onDeepLinkResolved', (data) => {
    console.log('Deep link resolved:', data.url);
    console.log('Metadata:', data.metadata);
    // Navigate to the appropriate screen in your app
});

// Listen for failed deep link resolution
ChottuLinkIonicSDK.addListener('onDeepLinkFailed', (data) => {
    console.error('Deep link failed:', data.error);
    console.log('Original URL:', data.originalURL);
});
const resolved = await ChottuLinkIonicSDK.getAppLinkDataFromUrl({
  shortURL: 'https://your-domain.com/abc123'
});

if (resolved) {
  console.log('Original link:', resolved.link);
  console.log('Short link:', resolved.shortLink);
  console.log('Short link Raw:', resolved.shortLinkRaw);
  console.log('isDeferred:', resolved.isDeferred);
}

Web

⚠️ Note: The plugin methods are not fully implemented on web. They will throw unimplemented errors. This plugin is primarily designed for native mobile platforms.

API

initialize(...)

initialize(options: { apiKey: string; }) => Promise<void>
ParamType
options{ apiKey: string; }
createDynamicLink(options: { builder: CLDynamicLinkBuilder; }) => Promise<{ shortURL: string | null; }>
ParamType
options{ builder: CLDynamicLinkBuilder; }

Returns: Promise<{ shortURL: string | null; }>

getAppLinkDataFromUrl(...)

getAppLinkDataFromUrl(options: { shortURL: string; }) => Promise<CLResolvedLink | null>
ParamType
options{ shortURL: string; }

Returns: Promise<CLResolvedLink | null>

addListener('onDeepLinkResolved', ...)

addListener(eventName: 'onDeepLinkResolved', listenerFunc: (data: { url: string; metadata?: Record<string, any>; }) => void) => Promise<PluginListenerHandle>
ParamType
eventName'onDeepLinkResolved'
listenerFunc(data: { url: string; metadata?: Record<string, any>; }) => void

Returns: Promise<PluginListenerHandle>

addListener('onDeepLinkFailed', ...)

addListener(eventName: 'onDeepLinkFailed', listenerFunc: (data: { error: string; originalURL?: string; }) => void) => Promise<PluginListenerHandle>
ParamType
eventName'onDeepLinkFailed'
listenerFunc(data: { error: string; originalURL?: string; }) => void

Returns: Promise<PluginListenerHandle>

Interfaces

CLDynamicLinkBuilder

PropType
destinationURLstring
domainstring
linkNamestring
androidBehaviourCLDynamicLinkBehaviour
iosBehaviourCLDynamicLinkBehaviour
selectedPathstring
socialTitlestring
socialDescriptionstring
socialImageUrlstring
utmSourcestring
utmMediumstring
utmCampaignstring
utmContentstring
utmTermstring
PropType
isDeferredboolean | null
linkstring | null
shortLinkstring | null
shortLinkRawstring | null

PluginListenerHandle

PropType
remove() => Promise<void>

Type Aliases

Record

Construct a type with a set of properties K of type T

{ [P in K]: T; }

Enums

CLDynamicLinkBehaviour

MembersValue
browser1
app2

Complete Example

Here's a complete example of how to use the plugin in your Capacitor app:

import { ChottuLinkIonicSDK, CLDynamicLinkBehaviour } from 'capacitor-chottulink-sdk';

// Initialize on app startup
async function initChottuLink() {
  try {
    await ChottuLinkIonicSDK.initialize({
      apiKey: 'your-api-key-here'
    });
    console.log('ChottuLink SDK initialized');
  } catch (error) {
    console.error('Failed to initialize ChottuLink:', error);
  }
}

// Set up deep link listeners
function setupDeepLinkListeners() {
  ChottuLinkIonicSDK.addListener('onDeepLinkResolved', (data) => {
    console.log('Deep link resolved:', data.url);
    // Navigate to the appropriate screen based on data.url
    // Example: router.push(parseUrl(data.url));
  });

  ChottuLinkIonicSDK.addListener('onDeepLinkFailed', (data) => {
    console.error('Deep link failed:', data.error);
    // Handle error appropriately
  });
}

// Create a dynamic link
async function shareProduct(productId: string) {
  try {
    const result = await ChottuLinkIonicSDK.createDynamicLink({
      builder: {
        destinationURL: `https://yourapp.com/products/${productId}`,
        domain: 'your-domain.com',
        linkName: `product-${productId}`,
        iosBehaviour: CLDynamicLinkBehaviour.app,
        androidBehaviour: CLDynamicLinkBehaviour.app,
        socialTitle: 'Check out this amazing product!',
        socialDescription: 'You won\'t believe what this product can do.',
        socialImageUrl: `https://yourapp.com/images/products/${productId}.jpg`,
        utmSource: 'app',
        utmMedium: 'share',
        utmCampaign: 'product-sharing'
      }
    });

    if (result.shortURL) {
      // Share the short URL
      await Share.share({ url: result.shortURL });
    }
  } catch (error) {
    console.error('Failed to create dynamic link:', error);
  }
}

// Initialize on app load
initChottuLink();
setupDeepLinkListeners();

For more detailed troubleshooting steps and testing procedures, visit: https://docs.chottulink.com/troubleshooting

Keywords

capacitor

FAQs

Package last updated on 02 Dec 2025

Did you know?

Socket

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.

Install

Related posts