Docs Self-Managed Reference Data Transforms SDKs JavaScript Schema Registry API You are viewing the Self-Managed v24.3 beta documentation. We welcome your feedback at the Redpanda Community Slack #beta-feedback channel. To view the latest available version of the docs, see v24.2. JavaScript Schema Registry API for Data Transforms This page contains the API reference for the Schema Registry client library of the data transforms JavaScript SDK. Functions newClient() newClient (): <<SchemaRegistryClient, `SchemaRegistryClient`>> Returns a client interface for interacting with Redpanda Schema Registry. Returns SchemaRegistryClient Example import { newClient, SchemaFormat } from "@redpanda-data/sr"; var sr_client = newClient(); const schema = { type: "record", name: "Example", fields: [ { "name": "a", "type": "long", "default": 0 }, { "name": "b", "type": "string", "default": "" } ] }; const subj_schema = sr_client.createSchema( "avro-value", { schema: JSON.stringify(schema), format: SchemaFormat.Avro, references: [], } ); decodeSchemaID() decodeSchemaID (`buf`): <<DecodeResult, `DecodeResult`>> Parameters buf: string, ArrayBuffer, or Uint8Array Returns DecodeResult in the same type as the given argument. Interfaces DecodeResult The result of a decodeSchemaID function. Properties id (read only): The decoded schema ID rest (read only): The remainder of the input buffer after stripping the encoded ID. Reference Properties name: string subject: string version: number Schema Properties format (read only): SchemaFormat references (read only): Reference schema (read only): string SchemaRegistryClient Client interface for interacting with Redpanda Schema Registry. Methods createSchema(subject (string), schema): SubjectSchema lookupLatestSchema(subject (string)): SubjectSchema lookupSchemaById(id (number)): Schema lookupSchemaByVersion(subject (string), version (number)): SubjectSchema SubjectSchema Properties id (read only): number schema (read only): Schema subject (read only): string version (read only): number Enumerations SchemaFormat Enumeration members Avro: 0 Protobuf: 1 JSON: 2 Suggested reading JavaScript API for Data Transforms Back to top × Simple online edits For simple changes, such as fixing a typo, you can edit the content directly on GitHub. Edit on GitHub Or, open an issue to let us know about something that you want us to change. Open an issue Contribution guide For extensive content updates, or if you prefer to work locally, read our contribution guide . Was this helpful? thumb_up thumb_down group Ask in the community mail Share your feedback group_add Make a contribution Data Transforms API Kubernetes