Streaming
Streaming releases
Beta
0
Supported
0
End of life
0
v25.2
Released
Jul 2025
Ended
Jul 2026
End of life
v25.1
Released
Apr 2025
Ended
Apr 2026
End of life
v24.3
Released
Dec 2024
Ended
Dec 2025
End of life
v24.2
Released
Jul 2024
Ended
Jul 2025
End of life
v24.1
Released
Apr 2024
Ended
Apr 2025
End of life
v23.3
Released
Dec 2023
Ended
Dec 2024
End of life
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.
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`>>
Returns
DecodeResult in the same type as the given argument.
Interfaces
DecodeResult
The result of a decodeSchemaID function.
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
Was this helpful?