Skip to content
This repository was archived by the owner on Oct 22, 2025. It is now read-only.

Commit 45e5eff

Browse files
committed
feat(framework-base): add createWithInput and createInRegion (#1138)
1 parent 73c59ee commit 45e5eff

File tree

1 file changed

+13
-1
lines changed
  • packages/frameworks/framework-base/lib

1 file changed

+13
-1
lines changed

packages/frameworks/framework-base/lib/mod.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ interface ActorStateReference<AD extends AnyActorDefinition> {
6060
* These are additional options that can be passed to the actor.
6161
*/
6262
params?: Record<string, string>;
63+
/** Region to create the actor in if it doesn't exist. */
64+
createInRegion?: string;
65+
/** Input data to pass to the actor. */
66+
createWithInput?: unknown;
6367
/**
6468
* Whether the actor is enabled.
6569
* Defaults to true.
@@ -98,6 +102,10 @@ export interface ActorOptions<
98102
* Parameters for the actor.
99103
*/
100104
params?: Registry[ExtractActorsFromRegistry<Registry>]["params"];
105+
/** Region to create the actor in if it doesn't exist. */
106+
createInRegion?: string;
107+
/** Input data to pass to the actor. */
108+
createWithInput?: unknown;
101109
/**
102110
* Whether the actor is enabled.
103111
* Defaults to true.
@@ -173,7 +181,11 @@ export function createRivetKit<
173181
const handle = client.getOrCreate(
174182
actor.opts.name as string,
175183
actor.opts.key,
176-
{ params: actor.opts.params },
184+
{
185+
params: actor.opts.params,
186+
createInRegion: actor.opts.createInRegion,
187+
createWithInput: actor.opts.createWithInput,
188+
},
177189
);
178190

179191
const connection = handle.connect();

0 commit comments

Comments
 (0)