@proveanything/smartlinks 1.0.43 → 1.0.45
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/API_SUMMARY.md +2 -2
- package/README.md +6 -4
- package/dist/api/authKit.js +2 -2
- package/dist/types/authKit.d.ts +1 -1
- package/package.json +1 -1
package/API_SUMMARY.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Smartlinks API Summary
|
|
2
2
|
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.45 | Generated: 2025-11-22T17:29:38.790Z
|
|
4
4
|
|
|
5
5
|
This is a concise summary of all available API functions and types.
|
|
6
6
|
|
|
@@ -239,7 +239,7 @@ interface AuthKitBrandingConfig {
|
|
|
239
239
|
**AuthKitConfig** (interface)
|
|
240
240
|
```typescript
|
|
241
241
|
interface AuthKitConfig {
|
|
242
|
-
|
|
242
|
+
id: string
|
|
243
243
|
branding?: AuthKitBrandingConfig
|
|
244
244
|
enabledProviders?: string[]
|
|
245
245
|
customCss?: string
|
package/README.md
CHANGED
|
@@ -21,12 +21,14 @@ npm install @proveanything/smartlinks
|
|
|
21
21
|
|
|
22
22
|
## Quick start
|
|
23
23
|
|
|
24
|
-
Initialize once at app startup with your API base URL. In Node, you can also provide an API key for server-to-server calls.
|
|
24
|
+
Initialize once at app startup with your API base URL. You may provide the URL with or without a trailing slash – the SDK normalizes it. In Node, you can also provide an API key for server-to-server calls.
|
|
25
25
|
|
|
26
26
|
```ts
|
|
27
27
|
import { initializeApi } from '@proveanything/smartlinks'
|
|
28
28
|
|
|
29
29
|
initializeApi({
|
|
30
|
+
// Both forms are accepted; trailing slashes are stripped automatically:
|
|
31
|
+
// baseURL: 'https://smartlinks.app/api/v1/'
|
|
30
32
|
baseURL: 'https://smartlinks.app/api/v1',
|
|
31
33
|
// apiKey: process.env.SMARTLINKS_API_KEY, // Node/server only (optional)
|
|
32
34
|
})
|
|
@@ -53,7 +55,7 @@ Use the built-in helpers to log in and verify tokens. After a successful login,
|
|
|
53
55
|
import { initializeApi } from '@proveanything/smartlinks'
|
|
54
56
|
import { auth } from '@proveanything/smartlinks'
|
|
55
57
|
|
|
56
|
-
initializeApi({ baseURL: 'https://smartlinks.app/api/v1' })
|
|
58
|
+
initializeApi({ baseURL: 'https://smartlinks.app/api/v1/' }) // works (slash removed internally)
|
|
57
59
|
|
|
58
60
|
// Email + password login (browser or Node)
|
|
59
61
|
const user = await auth.login('user@example.com', 'password')
|
|
@@ -133,7 +135,7 @@ The SDK works in modern browsers. Initialize once and call public endpoints with
|
|
|
133
135
|
import { initializeApi } from '@proveanything/smartlinks'
|
|
134
136
|
import { collection } from '@proveanything/smartlinks'
|
|
135
137
|
|
|
136
|
-
initializeApi({ baseURL: 'https://smartlinks.app/api/v1' })
|
|
138
|
+
initializeApi({ baseURL: 'https://smartlinks.app/api/v1' }) // trailing slash optional
|
|
137
139
|
const collections = await collection.list(false)
|
|
138
140
|
```
|
|
139
141
|
|
|
@@ -143,7 +145,7 @@ For a fuller UI example, see `examples/react-demo.tsx`.
|
|
|
143
145
|
|
|
144
146
|
```ts
|
|
145
147
|
initializeApi({
|
|
146
|
-
baseURL: string,
|
|
148
|
+
baseURL: string, // Provide with or without trailing slash; SDK normalizes
|
|
147
149
|
apiKey?: string, // Node/server only
|
|
148
150
|
bearerToken?: string, // optional at init; set by auth.login/verifyToken
|
|
149
151
|
proxyMode?: boolean // set true if running inside an iframe and using parent proxy
|
package/dist/api/authKit.js
CHANGED
|
@@ -67,12 +67,12 @@ export var authKit;
|
|
|
67
67
|
* Collection-based AuthKit
|
|
68
68
|
* =================================== */
|
|
69
69
|
async function load(authKitId) {
|
|
70
|
-
const path =
|
|
70
|
+
const path = `/authKit/${encodeURIComponent(authKitId)}`;
|
|
71
71
|
return request(path);
|
|
72
72
|
}
|
|
73
73
|
authKit.load = load;
|
|
74
74
|
async function get(collectionId, authKitId) {
|
|
75
|
-
const path =
|
|
75
|
+
const path = `/admin/collection/${encodeURIComponent(collectionId)}/authKit/${encodeURIComponent(authKitId)}`;
|
|
76
76
|
return request(path);
|
|
77
77
|
}
|
|
78
78
|
authKit.get = get;
|
package/dist/types/authKit.d.ts
CHANGED