@atlasauth/svelte 0.6.1 → 0.7.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/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # @atlasauth/svelte changelog
2
2
 
3
+ ## 0.7.0
4
+ - **Referral attribution.** The prebuilt forms send the referral the visitor arrived with on sign-in and sign-up (through `@atlasauth/js` 0.13.0) when the instance has referrals on, and show the captcha for a referred sign-up when the instance requires it. New init options: `referral?: false` and `referralConsent?`.
5
+
3
6
  ## 0.6.1
4
7
  - **`<UserProfile>` can verify an address.** Each unverified email address now has a **Verify** button: it emails a code (`POST /v1/client/me/email_addresses/{id}/prepare_verification`) and shows a field to enter it (`attempt_verification`), then reloads the user. This includes the sign-up address on an app that does not require email verification, which now reads unverified until it is proven. New catalog keys: `userProfile.verify`, `userProfile.verifyConfirm`, `userProfile.verifyCodePlaceholder`, `userProfile.verifySendFailed`, `userProfile.verifyCodeRejected`.
5
8
 
package/dist/context.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { type Readable } from 'svelte/store';
2
- import { type ProviderToken, type SignOutOptions, type SignOutResult, type SignOutEvent, type SignOutListener } from '@atlasauth/js';
2
+ import { type ProviderToken, type SignOutOptions, type SignOutResult, type SignOutEvent, type SignOutListener, type ReferralConsent } from '@atlasauth/js';
3
3
  import { type Catalog } from './i18n';
4
4
  import { type Appearance, type InstanceDesign } from './appearance';
5
5
  import type { AtlasOrganizationMembership, AtlasSession, AtlasUser, SessionClaims } from './types';
@@ -23,6 +23,18 @@ export type AuthStatus = 'loading' | 'signed_in' | 'signed_out';
23
23
  export declare const ATLAS_KEY: unique symbol;
24
24
  export interface AtlasInitOptions {
25
25
  publishableKey: string;
26
+ /**
27
+ * Referral attribution: the prebuilt forms send the referral the visitor
28
+ * arrived with on sign-in / sign-up when the instance has referrals on.
29
+ * `false` turns that off.
30
+ */
31
+ referral?: false;
32
+ /**
33
+ * The app's own consent decision for the referral tracking cookie, used only
34
+ * when Cookie Munch is not on the page: `'granted'` (or a function returning
35
+ * it) lets the forms read the cookie. Default: the cookie is not read.
36
+ */
37
+ referralConsent?: ReferralConsent;
26
38
  /**
27
39
  * The instance's Frontend API: an absolute URL such as
28
40
  * `"https://auth.example.com"`, or `"same-origin"` / a path such as `"/atlas"`
package/dist/context.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { getContext, setContext } from 'svelte';
2
2
  import { derived, get, writable } from 'svelte/store';
3
- import { FapiClient, SignOutGuard, TokenCache, closeOAuthPopupAfterSignIn, completeOAuthPopupLanding, getProviderToken as fetchProviderToken, mapOAuthPopupPayload, msUntilRefresh, readExpiry, readRedirectResult, resolveFrontendApi, stripRedirectParams, catalogLocale, SDK_HEADER, SignOutNotifier, getTemplateToken, reportSdkAdvisory, sdkHeaderValue, signOutReasonFromClient, } from '@atlasauth/js';
3
+ import { FapiClient, SignOutGuard, TokenCache, closeOAuthPopupAfterSignIn, completeOAuthPopupLanding, getProviderToken as fetchProviderToken, mapOAuthPopupPayload, msUntilRefresh, readExpiry, readRedirectResult, resolveFrontendApi, stripRedirectParams, catalogLocale, SDK_HEADER, SignOutNotifier, getTemplateToken, reportSdkAdvisory, sdkHeaderValue, signOutReasonFromClient, configureReferralCapture, } from '@atlasauth/js';
4
4
  import { ATLAS_SVELTE_SDK } from './version';
5
5
  import { EN_US, withFallback } from './i18n';
6
6
  import { instanceDesignFrom } from './appearance';
@@ -191,6 +191,8 @@ export function createAtlasClient(options) {
191
191
  await refresh();
192
192
  return cache.get(5_000)?.jwt ?? null;
193
193
  }
194
+ // Referral attribution: app-wide options every FAPI client on the page falls back to.
195
+ configureReferralCapture({ referral: options.referral, referralConsent: options.referralConsent });
194
196
  const fapiClient = new FapiClient({ publishableKey, baseUrl, fetchImpl: doFetch, locale, sdk: ATLAS_SVELTE_SDK });
195
197
  function getProviderToken(provider) {
196
198
  return fetchProviderToken(fapiClient, provider);
package/dist/version.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  import type { AtlasSdkInfo } from '@atlasauth/js';
2
2
  /** This package's version, sent as `X-Atlas-SDK` (kept in step with package.json by a test). */
3
- export declare const ATLAS_SVELTE_VERSION = "0.6.1";
3
+ export declare const ATLAS_SVELTE_VERSION = "0.7.0";
4
4
  export declare const ATLAS_SVELTE_SDK: AtlasSdkInfo;
package/dist/version.js CHANGED
@@ -1,3 +1,3 @@
1
1
  /** This package's version, sent as `X-Atlas-SDK` (kept in step with package.json by a test). */
2
- export const ATLAS_SVELTE_VERSION = '0.6.1';
2
+ export const ATLAS_SVELTE_VERSION = '0.7.0';
3
3
  export const ATLAS_SVELTE_SDK = { name: '@atlasauth/svelte', version: ATLAS_SVELTE_VERSION };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlasauth/svelte",
3
- "version": "0.6.1",
3
+ "version": "0.7.0",
4
4
  "type": "module",
5
5
  "svelte": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -23,9 +23,9 @@
23
23
  },
24
24
  "dependencies": {
25
25
  "@atlasauth/design": "0.2.0",
26
- "@atlasauth/js": "0.12.0",
26
+ "@atlasauth/backend": "0.10.0",
27
27
  "@atlasauth/authz": "0.1.1",
28
- "@atlasauth/backend": "0.9.0"
28
+ "@atlasauth/js": "0.13.0"
29
29
  },
30
30
  "peerDependencies": {
31
31
  "svelte": ">=4",