-
-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
enhancementNew feature or requestNew feature or request
Description
We're building a multi-tenant app where one server handles requests from different tenants. Each tenant has its own base_url for connections. Currently, we're using Skiffa to create agents like this:
export async function createAgent({
domain,
locale,
}: AgentProps) {
const baseUrl = someLogicToDetermineBaseUrl(domain)
sdk.client.defaultClientConfiguration.baseUrl = new URL(baseUrl);
const agent = sdk.client;
return agent;
}This approach has potential issues:
- It modifies a global configuration (defaultClientConfiguration).
- Parallel requests could overwrite each other's configurations, leading to race conditions and incorrect baseUrl assignments.
I would love the sdk.client to accept configuration on instantiation, allowing for per-request configurations:
export async function createAgent({
domain,
locale,
}: AgentProps) {
const baseUrl = someLogicToDetermineBaseUrl(domain)
const agent = new sdk.client({
defaultConfiguration: {baseUrl: new URL(baseUrl)}
});
return agent;
}Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request