@aiveth/react 0.10.0 → 0.11.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,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.11.0 — unreleased
4
+
5
+ - `signIn` and `<SignInButton>` / `<AivethButton>` take `invitation`: the token your own sign-in page got from an invitation email (`?invitation=`). The person joins the organization, signs in and comes back to your app. `authorizeHints()` passes it too.
6
+ - `loginHint` now opens Aiveth's page on that address's ways in, skipping the address screen.
7
+
3
8
  ## 0.10.0 — 2026-11-28
4
9
 
5
10
  - `signIn` and `<SignInButton>` / `<AivethButton>` take `connection` (`'google'`, `'microsoft'`, `'github'`, `'sso'`: straight to that way in, skipping Aiveth's page), `loginHint`, `locale` (`ui_locales`) and `screenHint: 'sign-up'` (`prompt=create`). `authorizeHints()` builds the same parameters.
package/dist/client.d.ts CHANGED
@@ -110,15 +110,17 @@ export interface SignInOptions {
110
110
  workspace?: string;
111
111
  /** Straight to Google, Microsoft, GitHub or your single sign-on — when your organization has it on. */
112
112
  connection?: Connection;
113
- /** The address to fill in (the person can change it). */
113
+ /** The address you already know: Aiveth's page opens on its ways in (the person can change it). */
114
114
  loginHint?: string;
115
115
  /** The sign-in page's language, e.g. `'hi'` or `'ta en'` (OpenID Connect `ui_locales`). */
116
116
  locale?: string;
117
117
  /** `'sign-up'`: the sign-up page, where your organization lets people join (`prompt=create`). */
118
118
  screenHint?: 'sign-in' | 'sign-up';
119
+ /** The `invitation` your sign-in page got from an invitation email: join, then back here. */
120
+ invitation?: string;
119
121
  }
120
122
  /** The authorize parameters for these hints — the same names in every Aiveth SDK. */
121
- export declare function authorizeHints({ connection, loginHint, locale, screenHint }: Omit<SignInOptions, 'returnTo' | 'workspace'>): Record<string, string>;
123
+ export declare function authorizeHints({ connection, loginHint, locale, screenHint, invitation }: Omit<SignInOptions, 'returnTo' | 'workspace'>): Record<string, string>;
122
124
  export declare class AivethClient {
123
125
  private readonly config;
124
126
  private readonly issuer;
@@ -138,8 +140,9 @@ export declare class AivethClient {
138
140
  private discover;
139
141
  /** To Aiveth's sign-in page; back at `redirectUri`, `handleRedirect` finishes. `connection`
140
142
  * skips the page and goes straight to that way in (when your organization has it on);
141
- * `loginHint` fills in the address; `locale` picks the page's language (`ui_locales`);
142
- * `screenHint: 'sign-up'` opens sign-up where your organization lets people join. */
143
+ * `loginHint` opens on that address's ways in; `locale` picks the page's language (`ui_locales`);
144
+ * `screenHint: 'sign-up'` opens sign-up where your organization lets people join;
145
+ * `invitation` (from your sign-in page's address) joins the organization first. */
143
146
  signIn({ returnTo, workspace, ...hints }?: SignInOptions): Promise<void>;
144
147
  /** On the return address: swap the code for tokens. Answers where the app wanted to go
145
148
  * (`returnTo`), or null when this page load isn't a return from Aiveth. */
package/dist/client.js CHANGED
@@ -59,8 +59,10 @@ export class RefusedError extends SignInError {
59
59
  }
60
60
  }
61
61
  /** The authorize parameters for these hints — the same names in every Aiveth SDK. */
62
- export function authorizeHints({ connection, loginHint, locale, screenHint }) {
62
+ export function authorizeHints({ connection, loginHint, locale, screenHint, invitation }) {
63
63
  const out = {};
64
+ if (invitation)
65
+ out.invitation = invitation;
64
66
  if (connection)
65
67
  out.connection = connection;
66
68
  if (loginHint)
@@ -117,8 +119,9 @@ export class AivethClient {
117
119
  }
118
120
  /** To Aiveth's sign-in page; back at `redirectUri`, `handleRedirect` finishes. `connection`
119
121
  * skips the page and goes straight to that way in (when your organization has it on);
120
- * `loginHint` fills in the address; `locale` picks the page's language (`ui_locales`);
121
- * `screenHint: 'sign-up'` opens sign-up where your organization lets people join. */
122
+ * `loginHint` opens on that address's ways in; `locale` picks the page's language (`ui_locales`);
123
+ * `screenHint: 'sign-up'` opens sign-up where your organization lets people join;
124
+ * `invitation` (from your sign-in page's address) joins the organization first. */
122
125
  async signIn({ returnTo, workspace, ...hints } = {}) {
123
126
  const found = await this.discover();
124
127
  const verifier = random(48);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiveth/react",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "description": "Official Aiveth SDK for React: sign in on Aiveth's page with PKCE, tokens kept in memory, and ready-made sign-in pieces.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Aiveth team",