SDK
Choose the right @microsoft/rayfin-* packages for a Rayfin 2.0 app, keep their versions in lockstep, and find each SDK reference page.
Rayfin packages are split by capability. In 2.0 the application client is assembled from the capabilities you register, so your app declares each one it uses: the client, an auth adapter, and the data, functions, connectors, or storage adapters. Changed in 2.0
Keep every @microsoft/rayfin-* package — and @microsoft/fabric-user-data-functions —
on the same exact version as the CLI.
Install packages at one version
All @microsoft/rayfin-* packages ship in lockstep. Do not mix
@microsoft/rayfin-client@2.0.0 with @microsoft/rayfin-core@1.36.2, or a CLI from a
different Rayfin release. 2.0 client code does not compile against 1.x packages.
A browser app with data, auth, and Fabric sign-in:
npm install @microsoft/rayfin-core@2.0.0 @microsoft/rayfin-client@2.0.0 @microsoft/rayfin-auth@2.0.0 @microsoft/rayfin-data@2.0.0 @microsoft/rayfin-auth-provider-fabric@2.0.0Add capability packages at the same exact version when you register them:
npm install @microsoft/rayfin-functions@2.0.0
npm install @microsoft/rayfin-storage@2.0.0
npm install @microsoft/rayfin-connectors@2.0.0The functions project itself depends on @microsoft/fabric-user-data-functions at exactly
the CLI version. The 2.0 CLI writes runtime metadata schema 3.0 and refuses to generate
types or deploy with an older worker, printing the npm install command to run.
Changed in 2.0
Which package do I need?
| I want to... | Package |
|---|---|
| Define entities, fields, relationships, permissions, validation, and storage folders | @microsoft/rayfin-core |
Compose one client with RayfinClient.create, sign in with a supplied token, or resolve runtime config | @microsoft/rayfin-client Changed in 2.0 |
Register client.data and query, mutate, and aggregate entities | @microsoft/rayfin-data |
Register client.auth with browserSession(), inspect sessions, and read claims | @microsoft/rayfin-auth |
| Add Microsoft Fabric SSO and direct Entra-token sign-in | @microsoft/rayfin-auth-provider-fabric |
Register client.functions and call Rayfin Functions | @microsoft/rayfin-functions |
Author Rayfin Functions with udf.func(), RayfinContext, AudienceType, and generated types | @microsoft/fabric-user-data-functions — documented under Functions; no SDK reference page. |
Route local Functions calls from Vite while rayfin dev is running | @microsoft/rayfin-local-dev — see Develop locally. |
Register client.storage to upload, download, list, and delete files | @microsoft/rayfin-storage |
| Send browser telemetry to the app's Application Insights resource | @microsoft/rayfin-telemetry New in 2.0 Experimental |
Register client.connectors for Fabric SQL sources, semantic models, and other connectors | @microsoft/rayfin-connectors |
| Type a Fabric SQL-backed connector entity | @microsoft/rayfin-connector-fabric-graphql |
| Type and run a Fabric semantic model connector | @microsoft/rayfin-connector-fabric-semanticmodel |
| Ask natural-language questions through the Fabric IQ connector | @microsoft/rayfin-connector-fabric-iq-mcp New in 2.0 |
| Maintain an existing Eventhouse connector (formerly Kusto) | @microsoft/rayfin-connector-eventhouse Changed in 2.0 Experimental |
| Embed a Rayfin app outside the Fabric portal | @microsoft/rayfin-embed-host New in 1.36 |
| Persist app state in Fabric | @microsoft/rayfin-app-state-fabric |
| Read lower-level HTTP, error, and client-composition types | @microsoft/rayfin-lib |
@microsoft/rayfin-connector-kusto is not published at 2.0; it was renamed to
@microsoft/rayfin-connector-eventhouse. Removed in 2.0
How the packages compose
@microsoft/rayfin-client depends only on @microsoft/rayfin-lib. Each adapter package
plugs into it through the factory types that rayfin-lib defines, and your app wires them
together in RayfinClient.create.
@microsoft/rayfin-core is mostly build-time: your rayfin/data/ and rayfin/storage/
classes import it so the CLI can generate backend configuration. It declares TypeScript
^5.7.2 || ^6.0.2 as a peer dependency, the compiler range the CLI uses for schema
compilation. Changed in 2.0
The client packages run in the browser, the Functions runtime, Node.js scripts, or a
connector runtime. @microsoft/fabric-user-data-functions is the function-authoring
surface documented in the Functions section. @microsoft/rayfin-local-dev provides the
Vite adapter that routes local calls under rayfin dev.
Package entry points
Every package now declares an exports map, so import only from documented entry points.
Deep imports into dist/ no longer resolve. Changed in 2.0
| Removed in 2.0 | Use instead |
|---|---|
@microsoft/rayfin-core/experimental | @microsoft/rayfin-core for blob, StorageObject, ContentTypes, bytes, kb, mb, gb, the storage option types, and the claims types RayfinBaseClaims, RayfinCustomClaims, AllClaims, ClientClaims |
@microsoft/rayfin-core/decorators | @microsoft/rayfin-core |
@microsoft/rayfin-client/experimental | @microsoft/rayfin-client, plus the adapter packages |
@microsoft/rayfin-connector-kusto | @microsoft/rayfin-connector-eventhouse |
Any @microsoft/rayfin-*/dist/... path | The package root or another documented entry point |
@microsoft/rayfin-local-dev/vite remains the stable entry point for the Vite adapter.
Version notes
- Keep the CLI, SDK packages, connector packages, and catalog packages on one Rayfin release version.
- Declare every package your code imports. 2.0 apps import
@microsoft/rayfin-authand@microsoft/rayfin-datadirectly, so they belong inpackage.jsoneven though older apps received them through@microsoft/rayfin-client. - Storage is generally available in 2.0 and needs no feature flag.
- Connectors are generally available;
rayfin up connector applyis still preview, and new Eventhouse connectors cannot be added in 2.0. - When you need the exact signature for the version installed in a project, use
rayfin docs getorrayfin docs searchfrom that project root instead of relying on a cached API shape.
In this section
@microsoft/rayfin-core— decorators for entities, fields, relationships, permissions, validation, and storage folder declarations.@microsoft/rayfin-client—RayfinClient.create,suppliedToken, runtime config resolution, disposal, and the 1.x migration map.@microsoft/rayfin-data—dataServiceand the fluent query, aggregation, and mutation API behindclient.data.@microsoft/rayfin-auth—browserSessionand the auth client behindclient.auth.@microsoft/rayfin-auth-provider-fabric— Fabric SSO and direct Entra token sign-in.@microsoft/rayfin-functions—functionsServiceand typed function calls.@microsoft/fabric-user-data-functions— function authoring helpers (udf.func(),RayfinContext,AudienceType, type generation); documented under Functions, with noreference/sdkpage.@microsoft/rayfin-local-dev— the Vite adapter for local routing underrayfin dev; see Develop locally, with noreference/sdkpage.@microsoft/rayfin-storage—storageServiceand the typed storage client.@microsoft/rayfin-telemetry— browser telemetry initialization for Observability.@microsoft/rayfin-connectors—connectorsService, the connector runtime, and typed connector clients.@microsoft/rayfin-connector-fabric-graphql— type-only marker for SQL-backed Fabric connector entities.@microsoft/rayfin-connector-fabric-semanticmodel— semantic model marker, runtime, and result helpers.@microsoft/rayfin-connector-fabric-iq-mcp— Fabric IQ connector marker, runtime, and conversation wrapper.@microsoft/rayfin-connector-eventhouse— Eventhouse connector support for existing projects.@microsoft/rayfin-embed-host— external embed host SDK.@microsoft/rayfin-app-state-fabric— Fabric app state SDK.@microsoft/rayfin-lib— shared HTTP client, errors, and client-composition types.
Environment variable interpolation
Use ${VAR} and ${VAR:-default} in rayfin.yml with Rayfin's .env resolution, type coercion, and missing-variable errors.
@microsoft/rayfin-core
Complete decorator reference for @microsoft/rayfin-core — entities, field types, relationships, and permissions that generate Data API Builder configuration.