@sesamy/sesamy-js 1.95.0 → 1.97.0
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/auth0-plugin.iife.js +4 -4
- package/dist/auth0-plugin.mjs +61 -62
- package/dist/sesamy-js.cjs +6 -6
- package/dist/sesamy-js.d.ts +12 -10
- package/dist/sesamy-js.iife.js +6 -6
- package/dist/sesamy-js.mjs +301 -299
- package/package.json +1 -1
package/dist/sesamy-js.d.ts
CHANGED
|
@@ -414,7 +414,12 @@ export declare interface HeaderCondition {
|
|
|
414
414
|
contains: string;
|
|
415
415
|
}
|
|
416
416
|
|
|
417
|
-
export declare function init(config: Config): Promise<SesamyAPI>;
|
|
417
|
+
export declare function init(config: Config, options?: InitOptions): Promise<SesamyAPI>;
|
|
418
|
+
|
|
419
|
+
export declare interface InitOptions {
|
|
420
|
+
/** Provide an auth plugin directly instead of relying on `registerAuthPlugin()` or the window factory. */
|
|
421
|
+
authPlugin?: AuthPlugin;
|
|
422
|
+
}
|
|
418
423
|
|
|
419
424
|
declare function isAuthenticated(): Promise<boolean>;
|
|
420
425
|
|
|
@@ -1117,20 +1122,17 @@ declare function registerAPI(config: ApiConfig): {
|
|
|
1117
1122
|
|
|
1118
1123
|
/**
|
|
1119
1124
|
* Register an auth plugin. Must be called before `sesamy.init()` to take
|
|
1120
|
-
* effect.
|
|
1121
|
-
* that existing publishers are unaffected.
|
|
1125
|
+
* effect.
|
|
1122
1126
|
*
|
|
1123
|
-
*
|
|
1124
|
-
*
|
|
1125
|
-
*
|
|
1126
|
-
* <script src="https://scripts.sesamy.com/s/vendor/bundle/stable.js"></script>
|
|
1127
|
-
* ```
|
|
1127
|
+
* Prefer passing `authPlugin` directly to `init()` for explicit wiring.
|
|
1128
|
+
* This function remains available for backwards compatibility and for the
|
|
1129
|
+
* DOM-based auto-init path (where init() is never called manually).
|
|
1128
1130
|
*
|
|
1129
1131
|
* @example
|
|
1130
1132
|
* ```ts
|
|
1131
|
-
* import {
|
|
1133
|
+
* import { init } from '@sesamy/sesamy-js';
|
|
1132
1134
|
* import { createAuth0Plugin } from '@sesamy/sesamy-js/auth0-plugin';
|
|
1133
|
-
*
|
|
1135
|
+
* await init(config, { authPlugin: createAuth0Plugin() });
|
|
1134
1136
|
* ```
|
|
1135
1137
|
*/
|
|
1136
1138
|
export declare function registerAuthPlugin(plugin: AuthPlugin): void;
|