MCPcopy Index your code
hub / github.com/triggerdotdev/trigger.dev / register

Method register

packages/nestjs/src/index.ts:78–101  ·  view source on GitHub ↗

* Register the instance for the TriggerDev client. * * Hint: If you want to have multiple instances of the client, you can use the `customProviderToken` to create multiple instances. * * @param options The options to use for the client * @param path The path to use for the controller

(
    options: typeof OPTIONS_TYPE,
    path: string = "/api/trigger",
    customProviderToken: InjectionToken = TriggerClientRef
  )

Source from the content-addressed store, hash-verified

76 * @param customProviderToken The token to use for the provider (default: {@link TriggerClientRef})
77 */
78 static register(
79 options: typeof OPTIONS_TYPE,
80 path: string = "/api/trigger",
81 customProviderToken: InjectionToken = TriggerClientRef
82 ): DynamicModule {
83 const { providers, ...rest } = ConfigurableModuleClass.register(options);
84 const controller = createControllerByPath(customProviderToken, path);
85
86 return {
87 ...rest,
88 controllers: [controller],
89 providers: [
90 ...(providers || []),
91 {
92 provide: customProviderToken,
93 inject: [MODULE_OPTIONS_TOKEN],
94 useFactory: (options: TriggerClientOptions) => {
95 return new TriggerClient(options);
96 },
97 },
98 ],
99 exports: [customProviderToken],
100 };
101 }
102
103 /**
104 * Register the instance for the TriggerDev client asynchronously.

Callers 5

initializeTracingFunction · 0.45
constructorMethod · 0.45
getTracerFunction · 0.45
byo-auth.tsFile · 0.45
getTracerFunction · 0.45

Calls 1

createControllerByPathFunction · 0.85

Tested by

no test coverage detected