@codetunezstudios/token-kit 0.1.0-beta.4 → 0.1.0-beta.5
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.
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -127,13 +127,13 @@ interface TokenKitConfig {
|
|
|
127
127
|
* ```typescript
|
|
128
128
|
* import { connectViaPortal } from '@codetunezstudios/token-kit';
|
|
129
129
|
*
|
|
130
|
-
* const userToken = await connectViaPortal({
|
|
130
|
+
* const userToken = await connectViaPortal({ clientId: 'app_abc123...' });
|
|
131
131
|
* tokenKit.setUserToken(userToken);
|
|
132
132
|
* ```
|
|
133
133
|
*/
|
|
134
134
|
interface ConnectViaPortalOptions {
|
|
135
|
-
/** The
|
|
136
|
-
|
|
135
|
+
/** The clientId of the developer app (created in the token-kit.com Apps dashboard). */
|
|
136
|
+
clientId: string;
|
|
137
137
|
/**
|
|
138
138
|
* Base URL of the Token-Kit portal.
|
|
139
139
|
* Defaults to 'https://ai-tokens.me'.
|
package/dist/index.d.ts
CHANGED
|
@@ -127,13 +127,13 @@ interface TokenKitConfig {
|
|
|
127
127
|
* ```typescript
|
|
128
128
|
* import { connectViaPortal } from '@codetunezstudios/token-kit';
|
|
129
129
|
*
|
|
130
|
-
* const userToken = await connectViaPortal({
|
|
130
|
+
* const userToken = await connectViaPortal({ clientId: 'app_abc123...' });
|
|
131
131
|
* tokenKit.setUserToken(userToken);
|
|
132
132
|
* ```
|
|
133
133
|
*/
|
|
134
134
|
interface ConnectViaPortalOptions {
|
|
135
|
-
/** The
|
|
136
|
-
|
|
135
|
+
/** The clientId of the developer app (created in the token-kit.com Apps dashboard). */
|
|
136
|
+
clientId: string;
|
|
137
137
|
/**
|
|
138
138
|
* Base URL of the Token-Kit portal.
|
|
139
139
|
* Defaults to 'https://ai-tokens.me'.
|
package/dist/index.js
CHANGED
|
@@ -219,7 +219,7 @@ var STORAGE_KEY = "tokenkit_user_token";
|
|
|
219
219
|
async function connectViaPortal(options) {
|
|
220
220
|
const portalUrl = (options.portalUrl ?? "https://ai-tokens.me").replace(/\/$/, "");
|
|
221
221
|
const currentOrigin = encodeURIComponent(window.location.origin);
|
|
222
|
-
const url = `${portalUrl}/connect?
|
|
222
|
+
const url = `${portalUrl}/connect?clientId=${encodeURIComponent(options.clientId)}&origin=${currentOrigin}`;
|
|
223
223
|
const popup = window.open(
|
|
224
224
|
url,
|
|
225
225
|
"tokenkit-connect",
|
package/dist/index.mjs
CHANGED
|
@@ -176,7 +176,7 @@ var STORAGE_KEY = "tokenkit_user_token";
|
|
|
176
176
|
async function connectViaPortal(options) {
|
|
177
177
|
const portalUrl = (options.portalUrl ?? "https://ai-tokens.me").replace(/\/$/, "");
|
|
178
178
|
const currentOrigin = encodeURIComponent(window.location.origin);
|
|
179
|
-
const url = `${portalUrl}/connect?
|
|
179
|
+
const url = `${portalUrl}/connect?clientId=${encodeURIComponent(options.clientId)}&origin=${currentOrigin}`;
|
|
180
180
|
const popup = window.open(
|
|
181
181
|
url,
|
|
182
182
|
"tokenkit-connect",
|
package/package.json
CHANGED