MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / buildClient

Function buildClient

packages/plugins/workos-vault/src/sdk/plugin.ts:44–56  ·  view source on GitHub ↗
(
  options: WorkOSVaultPluginOptions | undefined,
)

Source from the content-addressed store, hash-verified

42type WorkosVaultPluginStore = WorkosVaultStore;
43
44const buildClient = (
45 options: WorkOSVaultPluginOptions | undefined,
46): Effect.Effect<WorkOSVaultClient, WorkOSVaultClientInstantiationError, never> => {
47 if (options?.client) return Effect.succeed(options.client);
48 if (options?.credentials) {
49 return makeConfiguredWorkOSVaultClient(options.credentials);
50 }
51 return Effect.fail(
52 new WorkOSVaultClientInstantiationError({
53 cause: "workosVaultPlugin requires either `client` or `credentials` to be provided",
54 }),
55 );
56};
57
58export const workosVaultPlugin = definePlugin((options?: WorkOSVaultPluginOptions) => ({
59 id: "workosVault" as const,

Callers 1

plugin.tsFile · 0.85

Calls 1

Tested by

no test coverage detected