@lancedb/lancedb • Docs
@lancedb/lancedb / StaticHeaderProvider
Class: StaticHeaderProvider¶
Example implementation: A simple header provider that returns static headers.
This is an example implementation showing how to create a HeaderProvider for cases where headers don't change during the session.
Example¶
const provider = new StaticHeaderProvider({
authorization: "Bearer my-token",
"X-Custom-Header": "custom-value"
});
const headers = provider.getHeaders();
// Returns: {authorization: 'Bearer my-token', 'X-Custom-Header': 'custom-value'}
Extends¶
Constructors¶
new StaticHeaderProvider()¶
Initialize with static headers.
Parameters¶
- headers:
Record<string,string> Headers to return for every request.
Returns¶
Overrides¶
Methods¶
getHeaders()¶
Return the static headers.
Returns¶
Record<string, string>
Copy of the static headers.