Rayfin

Deprecations

APIs, settings, and flags deprecated or removed in recent Rayfin releases with their replacements, and how to silence Rayfin's deprecation warnings.

Use this page when you upgrade a Rayfin project or see a deprecation warning. The tables list what changed and what to use instead; the Changelog has the full upgrade steps for each release.

Deprecated or removed in 1.36

OldUse insteadStatus
ctx.getToken(AudienceType.Sql) in a functionDeclare the audience — RayfinContext<Schema, AudienceType.Sql> — and read ctx.Tokens.Sql. See Connections.Deprecated in 1.36
ctx.getSecret('API_KEY') in a functionctx.Secrets.API_KEY, after declaring the secret with rayfin secret set API_KEY --describe="...". See Secrets in functions.Deprecated in 1.36
Enabled Functions with no services.functions.authservices.functions.auth.type: application. Function connections now run as the app identity.Changed in 1.36
AudienceType.CosmosDB, KeyVault, EventGrid, Kusto, WorkIQNo replacement audience. For services that accept keys, store a credential with rayfin secret set.Removed in 1.36
entity, field decorators, and RayfinPrimaryKey from @microsoft/rayfin-core/experimentalImport them from @microsoft/rayfin-core. Only blob and the storage helpers remain on the experimental path.Removed in 1.36
Source and AutoGenerated from @microsoft/rayfin-core/experimentalImport them from @microsoft/rayfin-connectors.Removed in 1.36
ConnectorsRayfinClient from @microsoft/rayfin-client/experimentalImport it from @microsoft/rayfin-client. The experimental path still re-exports it.Deprecated in 1.36
services.connectors.enabled in rayfin.ymlRemove it. The rayfin connector commands are always available.Deprecated in 1.36
RAYFIN_FEATURE_FLAGS=functions or =connectorsNothing. Functions and connectors no longer need a flag.Removed in 1.36
rayfin connector add --type kustoKeep existing Kusto connectors; new ones cannot be added in 1.36.Changed in 1.36
Storage per-call options such as onProgress and onConflict, and the StorageConflictMode / UploadProgressEvent exportsSee Storage for the 1.36 client surface. Storage is experimental.Removed in 1.36

Deprecated in 1.35.1

OldUse insteadStatus
services.staticHosting.anonymousAccessservices.staticHosting.assetAccess: protected or public. rayfin up removes the old key when it records the new one. See Hosting.Deprecated in 1.35.1

Deprecated before 1.35

OldUse insteadWarning code
The useProxy client optionSet baseUrl instead: an empty string ('') keeps requests same-origin so a dev-server proxy can forward them, and an absolute URL calls the backend directly. useProxy has no effect.RAYFIN_DEP_USE_PROXY

How deprecation warnings work

Rayfin emits a deprecation warning when your application uses an API or option that will change in a future release. Warnings are printed with console.warn and include a stable code such as [RAYFIN_DEP_USE_PROXY], so you can search your codebase for the affected usage. TypeScript also marks deprecated members, such as ctx.getToken(), with @deprecated, so your editor strikes them through.

Silence warnings in application code

Call setDeprecationsSilenced(true) once you've reviewed the warnings and want to hide them for a specific environment. Import it from @microsoft/rayfin-client and call it early in application startup, before creating Rayfin clients or using deprecated APIs.

import { setDeprecationsSilenced } from '@microsoft/rayfin-client';

setDeprecationsSilenced(true);

Call setDeprecationsSilenced(false) to turn warnings back on, and isDeprecationSilenced() to check the current setting:

import { isDeprecationSilenced } from '@microsoft/rayfin-client';

console.log(isDeprecationSilenced());

Silence warnings in Node.js

For Node.js scripts, tests, or server-side tooling, set RAYFIN_NO_DEPRECATION to 1 or true in the environment:

RAYFIN_NO_DEPRECATION=1 npm test

Silence warnings in browser apps

Browser environments have no Node.js process environment, so RAYFIN_NO_DEPRECATION has no effect there. Use the programmatic toggle instead, and call it during application startup — before any code path that could emit a deprecation warning runs.

src/main.ts
import { setDeprecationsSilenced } from '@microsoft/rayfin-client';

if (import.meta.env.PROD) {
  setDeprecationsSilenced(true);
}

See also

Something wrong on this page?Report an issueEdit this page

On this page