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

Method registerAsync

packages/nestjs/src/index.ts:112–135  ·  view source on GitHub ↗

* Register the instance for the TriggerDev client asynchronously. * * 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

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

Source from the content-addressed store, hash-verified

110 * @param customProviderToken The token to use for the provider (default: {@link TriggerClientRef})
111 */
112 static registerAsync(
113 options: typeof ASYNC_OPTIONS_TYPE,
114 path: string = "/api/trigger",
115 customProviderToken: InjectionToken = TriggerClientRef
116 ): DynamicModule {
117 const { providers, ...rest } = ConfigurableModuleClass.registerAsync(options);
118 const controller = createControllerByPath(customProviderToken, path);
119
120 return {
121 ...rest,
122 controllers: [controller],
123 providers: [
124 ...(providers || []),
125 {
126 provide: customProviderToken,
127 inject: [MODULE_OPTIONS_TOKEN],
128 useFactory: (options: TriggerClientOptions) => {
129 return new TriggerClient(options);
130 },
131 },
132 ],
133 exports: [customProviderToken],
134 };
135 }
136}
137
138/**

Callers 1

app.module.tsFile · 0.80

Calls 1

createControllerByPathFunction · 0.85

Tested by

no test coverage detected