SDK / WEB

Deep linking for web experiences.

Use the server client for protected link-management operations, or call browser-safe helpers for explicit matching and link resolution.

Package

@wilderlinks/wilderlinks-sdk

1.0.5

01 / Install

Add the SDK

Terminalshell
npm install @wilderlinks/wilderlinks-sdk@1.0.5

02 / Configure

Initialize once

Use the WilderLinks API base URL and add the exact link host configured for your app. Replace links.example.com with that host.

links.server.tstypescript
import { WilderlinksClient } from '@wilderlinks/wilderlinks-sdk';

// Run only on a trusted server. Keep this key out of browser bundles.
const wilderlinks = new WilderlinksClient({
  apiKey: process.env.WILDERLINKS_API_KEY!,
  baseUrl: 'https://api.wilderlinks.space',
});

export async function createOfferLink() {
  return wilderlinks.createDeepLink({
    defaultUrl: 'https://www.example.com/offers',
    deepLinkPayload: { screen: 'offers' },
  });
}

04 / Deferred matching

Match only tokens your app can access

browser-match.tstypescript
import { checkDeferredMatch } from '@wilderlinks/wilderlinks-sdk';

async function checkBrowserDeferredMatch() {
  const result = await checkDeferredMatch('https://api.wilderlinks.space');
  if (result.matched) {
    console.log(result.deepLinkPayload);
  }
}

  • The browser helper can match a token only when the app-open interstitial flow has stored it in localStorage.
  • Deferred match methods return matched, installId, openId, deepLinkPayload, destinationUrl, installAttributionProvider, and error; resolveLink has a different result shape shown above.
  • Current mobile deferred-install attribution should use the platform SDK or an explicit token exchange; browser localStorage is not a mobile install-referrer mechanism.
  • matchInstallAttributionToken(baseUrl, token, provider) exchanges a token obtained by your own attribution flow.

05 / Platform setup

Before testing on a device

  • WilderlinksClient is for trusted server runtimes: its apiKey authenticates link-management requests. Never instantiate it in browser code or expose the key in a client bundle.
  • resolveLink(...) is a browser-safe helper but calls the live /api/v1/resolve endpoint. It is for runtime resolution, not a side-effect-free preview.
  • checkDeferredMatch(baseUrl) reads dl_match_token from localStorage and posts it to /api/v1/match. It does not retrieve a token from an app store.

06 / Security

Keep private credentials server-side

Do not ship organization or private API keys in mobile apps, browser JavaScript, or Unity client builds. Client-side link resolution and authenticated link-management operations have different trust boundaries; keep API-key operations in a trusted server environment.

The Web SDK’s WilderlinksClient authenticates link-management requests with its API key. Browser helpers do not need that client key.

07 / Troubleshooting

When a link does not match

  • Keep the API key on a trusted server and call server client methods only from server code.
  • Check domain and slug values passed to resolveLink(...); the helper constructs a live resolver request from those values.
  • If checkDeferredMatch(...) returns unmatched, confirm the token exists in localStorage and that the browser can reach the configured API base URL.

Continue building