{"record":{"id":"561f04bb84b62d56","repo":"anomalyco/sst","slug":"sst-linkable-is-deprecated-use-sst-linkable-wrap","errorCode":null,"errorMessage":"sst.linkable is deprecated. Use sst.Linkable.wrap instead.","messagePattern":"sst\\.linkable is deprecated\\. Use sst\\.Linkable\\.wrap instead\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"platform/src/components/link.ts","lineNumber":196,"sourceCode":"    input?: Input<any[]>,\n  ): Output<T[]> {\n    if (!input) return output([]);\n    return output(input).apply((links) => {\n      return links.filter(isLinkable).flatMap((l: Linkable) => {\n        const link = l.getSSTLink();\n        return (link.include || []).filter((i) => i.type === type) as T[];\n      });\n    });\n  }\n\n  /** @deprecated\n   * Use sst.Linkable.wrap instead.\n   */\n  export function linkable<T>(\n    obj: { new (...args: any[]): T },\n    cb: (resource: T) => Definition,\n  ) {\n    console.warn(\"sst.linkable is deprecated. Use sst.Linkable.wrap instead.\");\n    obj.prototype.getSSTLink = function () {\n      return cb(this);\n    };\n  }\n}\n","sourceCodeStart":178,"sourceCodeEnd":202,"githubUrl":"https://github.com/anomalyco/sst/blob/a0bd20f762883e72a35caccb4896c42ce5b3f707/platform/src/components/link.ts#L178-L202","documentation":"sst.linkable was the old API for making an arbitrary class instance participate in SST's resource-link system. It now emits a deprecation console.warn and forwards to the same behavior; developers should migrate to sst.Linkable.wrap, which is the supported public interface for defining custom links.","triggerScenarios":"Calling the exported `linkable` function directly, e.g. `sst.linkable(MyClass, (m) => ({ properties: {...} }))` in sst.config.ts, or using a library/plugin that still references sst.linkable — the warning fires at bundle/interpret time when the function is invoked.","commonSituations":"Following older SST documentation, blog posts, or copied snippets that predate the Linkable.wrap API; third-party SST helper libraries not yet updated; incremental migration where some links still use the legacy call.","solutions":["Replace the call with `sst.Linkable.wrap(MyClass, (m) => ({ properties: {...} }))` — signature and behavior are equivalent","If the warning comes from a dependency, update that package to a version using sst.Linkable.wrap, or file/patch the import","Silence-and-track interim: filter the console.warn during deploys while migration is pending (not recommended long-term)"],"exampleFix":"// before\nsst.linkable(MyResource, (m) => ({ properties: { ref: m.ref } }))\n// after\nsst.Linkable.wrap(MyResource, (m) => ({ properties: { ref: m.ref } }))","handlingStrategy":"type-guard","validationCode":"function usesLegacyLinkable(src: string): boolean {\n  return /\\bsst\\.linkable\\s*\\(/.test(src);\n}\n// scan sst.config.ts and deps; if true, migrate to sst.Linkable.wrap before deploying","typeGuard":"function isLinkableCallable(obj: unknown): obj is { linkable: (cls: any, cb: (r: any) => any) => void } {\n  return typeof (obj as any)?.linkable === \"function\" && typeof (obj as any)?.Linkable?.wrap === \"function\";\n}","tryCatchPattern":"// deprecation warning is not throwable; detect and migrate:\nconst origWarn = console.warn;\nconsole.warn = (...args) => {\n  if (String(args[0]).includes(\"sst.linkable is deprecated\")) {\n    migrationNeeded = true;\n    return;\n  }\n  origWarn(...args);\n};","preventionTips":["Grep your repo for `sst.linkable(` in CI and fail the build if found","Prefer sst.Linkable.wrap in all new link definitions","Keep SST helper libraries updated to versions using the current API","Read the SST changelog when upgrading major versions to catch API deprecations early"],"tags":["deprecation","linkable","api-migration"],"backgroundTag":"deprecated-api-usage","analyzedSha":"a0bd20f762883e72a35caccb4896c42ce5b3f707","analyzedAt":"2026-08-30T11:26:00.383Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}