rn-prodeeplinks 0.0.6 → 0.0.8

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.
Files changed (2) hide show
  1. package/lib/api.js +6 -8
  2. package/package.json +1 -1
package/lib/api.js CHANGED
@@ -7,8 +7,9 @@ exports.validateLicenseInit = validateLicenseInit;
7
7
  exports.matchFingerprintCustom = matchFingerprintCustom;
8
8
  exports.trackCustomDeepLinkEvent = trackCustomDeepLinkEvent;
9
9
  const license_1 = require("./license");
10
- const DEFAULT_API_ENDPOINT = 'https://api.prodeeplink.com';
11
- const ANALYTICS_ENDPOINT = `${DEFAULT_API_ENDPOINT}/custom-deep-link/track/event`;
10
+ const BASE_API_URL = 'https://api.prodeeplink.com';
11
+ const DEFAULT_API_ENDPOINT = `${BASE_API_URL}/v1/deeplink`;
12
+ const ANALYTICS_ENDPOINT = `${BASE_API_URL}/custom-deep-link/track/event`;
12
13
  /**
13
14
  * Call API to get deep link URL
14
15
  * This function sends device fingerprint and license key to server
@@ -24,13 +25,9 @@ async function fetchDeepLinkUrl(licenseKey, fingerprint, apiEndpoint, timeout =
24
25
  error: validation.message || 'Invalid license key',
25
26
  };
26
27
  }
27
- const PACKAGE_NAME = 'react-native-pro-deeplink';
28
- const PACKAGE_VERSION = '0.0.5';
29
28
  const payload = {
30
29
  licenseKey,
31
30
  fingerprint: fingerprint,
32
- packageName: PACKAGE_NAME,
33
- packageVersion: PACKAGE_VERSION,
34
31
  timestamp: Date.now(),
35
32
  };
36
33
  // Make API call with timeout
@@ -150,7 +147,7 @@ async function validateLicenseCustom(licenseKey, opts) {
150
147
  }
151
148
  async function validateLicenseInit(licenseKey) {
152
149
  try {
153
- const endpoint = `${DEFAULT_API_ENDPOINT}/custom-deep-link/license/validate`;
150
+ const endpoint = `${BASE_API_URL}/custom-deep-link/license/validate`;
154
151
  const res = await fetch(endpoint, {
155
152
  method: 'POST',
156
153
  headers: {
@@ -179,7 +176,8 @@ async function validateLicenseInit(licenseKey) {
179
176
  }
180
177
  async function matchFingerprintCustom(payload, baseUrl, licenseKey) {
181
178
  try {
182
- const endpoint = `${DEFAULT_API_ENDPOINT}/custom-deep-link/fingerprint/match`;
179
+ const base = (baseUrl || BASE_API_URL).trim().replace(/\/+$/, '');
180
+ const endpoint = `${base}/custom-deep-link/fingerprint/match`;
183
181
  const res = await fetch(endpoint, {
184
182
  method: 'POST',
185
183
  headers: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rn-prodeeplinks",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "description": "Secure deep linking package with license key validation and device fingerprinting for React Native",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",