@raindrop-ai/ai-sdk 0.0.19-beta.3 → 0.0.19

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/README.md CHANGED
@@ -58,7 +58,20 @@ If `userId` is missing from both `wrap()` context and `eventMetadata()`, the SDK
58
58
 
59
59
  ## Runtime support
60
60
 
61
- ### Node.js (recommended)
61
+ ### Browsers and edge runtimes
62
+
63
+ Use the browser entrypoint:
64
+
65
+ ```ts
66
+ import { createRaindropAISDK } from "@raindrop-ai/ai-sdk/browser";
67
+ ```
68
+
69
+ The SDK works without `async_hooks` shims. When `AsyncLocalStorage` is not available,
70
+ Raindrop falls back to synchronous context scoping: nested work in the same call stack
71
+ still inherits context, but automatic propagation across arbitrary async boundaries is
72
+ not guaranteed.
73
+
74
+ ### Node.js
62
75
 
63
76
  Use the default import:
64
77
 
@@ -66,17 +79,23 @@ Use the default import:
66
79
  import { createRaindropAISDK } from "@raindrop-ai/ai-sdk";
67
80
  ```
68
81
 
82
+ In Node, the default entrypoint wires up `AsyncLocalStorage` automatically.
83
+
69
84
  ### Cloudflare Workers
70
85
 
71
86
  Cloudflare Workers can provide `AsyncLocalStorage` via `node:async_hooks` when `nodejs_compat` is enabled ([docs](https://developers.cloudflare.com/workers/runtime-apis/nodejs/asynclocalstorage/)).
72
87
 
73
- Use the Workers entrypoint:
88
+ If `nodejs_compat` is enabled, use the Workers entrypoint:
74
89
 
75
90
  ```ts
76
91
  import { createRaindropAISDK } from "@raindrop-ai/ai-sdk/workers";
77
92
  ```
78
93
 
79
- If `nodejs_compat` is not enabled, AsyncLocalStorage-based context propagation cannot work.
94
+ This enables real `AsyncLocalStorage` propagation in Workers.
95
+
96
+ If `nodejs_compat` is not enabled, use the browser entrypoint instead. The SDK still works,
97
+ but it uses the same synchronous fallback described above rather than real
98
+ `AsyncLocalStorage`.
80
99
 
81
100
  ## Supported AI SDK Versions
82
101