MCPcopy
hub / github.com/directus/directus / createDirectus

Function createDirectus

sdk/src/client.ts:21–33  ·  view source on GitHub ↗
(url: string, options: ClientOptions = {})

Source from the content-addressed store, hash-verified

19 * @returns A Directus client.
20 */
21export const createDirectus = <Schema = any>(url: string, options: ClientOptions = {}): DirectusClient<Schema> => {
22 const globals = options.globals ? { ...defaultGlobals, ...options.globals } : defaultGlobals;
23 return {
24 globals,
25 url: new globals.URL(url),
26 with(createExtension) {
27 return {
28 ...this,
29 ...createExtension(this),
30 };
31 },
32 };
33};

Calls

no outgoing calls

Tested by

no test coverage detected