Skip to content

Commit 4370b1b

Browse files
yosriadyclaude
andcommitted
docs: simplify Angular SDK docs
Remove version-specific references and tighten Angular setup guidance. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent e2e6aec commit 4370b1b

2 files changed

Lines changed: 9 additions & 13 deletions

File tree

install.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -643,14 +643,14 @@ Make sure you use the same `<SDK_WRITE_KEY>` for both your website and your app.
643643
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.
644644
</Note>
645645

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`).
647647

648648
#### 1. Install the Formo SDK
649649

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:
651651

652652
```bash
653-
pnpm add @formo/analytics@^1.30.1 buffer viem
653+
pnpm add @formo/analytics buffer viem
654654
pnpm add -D @ngx-env/builder
655655
```
656656

sdks/web.mdx

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,13 @@ export default HomePage;
147147
### Angular
148148

149149
<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).
151151
</Note>
152152

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`.
154154

155155
```bash
156-
npm install @formo/analytics@^1.30.1 buffer viem --save
156+
npm install @formo/analytics buffer viem --save
157157
```
158158

159159
```ts
@@ -170,7 +170,7 @@ import { Buffer } from 'buffer';
170170
}
171171
```
172172

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:
174174

175175
```ts
176176
// src/app/services/formo-analytics.service.ts
@@ -217,10 +217,6 @@ export const appConfig: ApplicationConfig = {
217217
};
218218
```
219219

220-
<Note>
221-
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-
224220
## Identify users
225221

226222
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
302298
```
303299
</Tab>
304300
<Tab title="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:
306302

307303
```ts
308304
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
322318
}
323319
```
324320

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.
326322
</Tab>
327323
</Tabs>
328324

0 commit comments

Comments
 (0)