You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: install.mdx
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -643,14 +643,14 @@ Make sure you use the same `<SDK_WRITE_KEY>` for both your website and your app.
643
643
Working example: [with-angular](https://github.com/getformo/examples/tree/main/with-angular). Also see the [Angular section](/sdks/web#angular) of the Web SDK page.
644
644
</Note>
645
645
646
-
Angular has no first-class Formo binding — `FormoAnalyticsProvider` and `useFormo()` are React-only. Angular apps install Formo on the **non-wagmi, non-React path**: import the framework-agnostic `FormoAnalytics.init()` core from the [`@formo/analytics/core`](https://github.com/getformo/sdk/releases/tag/v1.30.1) subpath (added in **v1.30.1**), wrap it in an injectable service, and connect wallets over the bare EIP-1193 provider (`window.ethereum`).
646
+
Angular has no first-class Formo binding — `FormoAnalyticsProvider` and `useFormo()` are React-only. Angular apps install Formo on the **non-wagmi, non-React path**: import the framework-agnostic `FormoAnalytics.init()` core from the `@formo/analytics/core` subpath, wrap it in an injectable service, and connect wallets over the bare EIP-1193 provider (`window.ethereum`).
647
647
648
648
#### 1. Install the Formo SDK
649
649
650
-
Install the SDK (v1.30.1 or later) along with the `buffer` polyfill (Angular's esbuild build doesn't auto-polyfill Node globals, but the SDK uses `Buffer` to decode signed-message payloads) and viem:
650
+
Install the SDK along with the `buffer` polyfill (Angular's esbuild build doesn't auto-polyfill Node globals, but the SDK uses `Buffer` to decode signed-message payloads) and viem:
Copy file name to clipboardExpand all lines: sdks/web.mdx
+6-10Lines changed: 6 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -147,13 +147,13 @@ export default HomePage;
147
147
### Angular
148
148
149
149
<Note>
150
-
`FormoAnalyticsProvider` and `useFormo()` are React-only. Angular apps import from the React-free [`@formo/analytics/core`](https://github.com/getformo/sdk/releases/tag/v1.30.1) subpath (added in **v1.30.1**) and wrap `FormoAnalytics.init()` in an injectable service, with wallets connected over the bare EIP-1193 provider (`window.ethereum`). Full working example: [with-angular](https://github.com/getformo/examples/tree/main/with-angular).
150
+
`FormoAnalyticsProvider` and `useFormo()` are React-only. Angular apps import from the React-free `@formo/analytics/core` subpath and wrap `FormoAnalytics.init()` in an injectable service, with wallets connected over the bare EIP-1193 provider (`window.ethereum`). Full working example: [with-angular](https://github.com/getformo/examples/tree/main/with-angular).
151
151
</Note>
152
152
153
-
Install the Web SDK (v1.30.1 or later) along with the `buffer` polyfill. Angular's esbuild build doesn't auto-polyfill Node globals, but the SDK uses `Buffer` to decode signed-message payloads — without it, signing throws `ReferenceError: Buffer is not defined`.
153
+
Install the Web SDK along with the `buffer` polyfill. Angular's esbuild build doesn't auto-polyfill Node globals, but the SDK uses `Buffer` to decode signed-message payloads. Without it, signing throws `ReferenceError: Buffer is not defined`.
@@ -170,7 +170,7 @@ import { Buffer } from 'buffer';
170
170
}
171
171
```
172
172
173
-
Wrap `FormoAnalytics.init()` in an injectable service. Import from `@formo/analytics/core` — the root entry pulls in the React provider, which Angular doesn't need:
173
+
Wrap `FormoAnalytics.init()` in an injectable service. Import from `@formo/analytics/core`; the root entry pulls in the React provider, which Angular doesn't need:
Angular Router navigates with `history.pushState`, which the SDK hooks on init — page changes are autocaptured. Don't add a `NavigationEnd` subscription that calls `formo.page()` or you'll double-count.
222
-
</Note>
223
-
224
220
## Identify users
225
221
226
222
Call [`identify()`](/data/events/identify) after a user connects their wallet or signs in on your website or app:
@@ -302,7 +298,7 @@ If no parameters are specified, the Formo SDK will attempt to auto-identify the
302
298
```
303
299
</Tab>
304
300
<Tabtitle="Angular">
305
-
Inject the analytics service and call `identify()` from the same place you discover the wallet address (for example, a `WalletService` that drives `eth_requestAccounts`):
301
+
Inject the analytics service and call `identify()` from the same place you discover the wallet address:
306
302
307
303
```ts
308
304
import { Injectable, inject, signal } from'@angular/core';
@@ -322,7 +318,7 @@ If no parameters are specified, the Formo SDK will attempt to auto-identify the
322
318
}
323
319
```
324
320
325
-
See the [with-angular example](https://github.com/getformo/examples/tree/main/with-angular) for the full wallet service, including the hydrate-on-load and `wallet_revokePermissions` patterns.
321
+
See the [with-angular example](https://github.com/getformo/examples/tree/main/with-angular) for a full working example.
0 commit comments