diff --git a/.changeset/tiny-carrots-shake.md b/.changeset/tiny-carrots-shake.md new file mode 100644 index 000000000..b72537ed2 --- /dev/null +++ b/.changeset/tiny-carrots-shake.md @@ -0,0 +1,5 @@ +--- +"frames.js": patch +--- + +feat: support for cast action postUrl property diff --git a/packages/frames.js/src/core/types.ts b/packages/frames.js/src/core/types.ts index 7dd889b5b..329916bfa 100644 --- a/packages/frames.js/src/core/types.ts +++ b/packages/frames.js/src/core/types.ts @@ -431,6 +431,8 @@ export type CastActionResponse = { /** The action type. (Same type options as frame buttons). Only post is accepted in V1. */ action: { type: "post"; + /** Optional action handler URL. If not provided, clients will POST to the same URL as the action metadata route. */ + postUrl?: string; }; }; diff --git a/packages/render/src/use-fetch-frame.ts b/packages/render/src/use-fetch-frame.ts index 63c765cac..1a9af0717 100644 --- a/packages/render/src/use-fetch-frame.ts +++ b/packages/render/src/use-fetch-frame.ts @@ -607,7 +607,7 @@ export function useFetchFrame< const frameButton: FrameButtonPost = { action: "post", label: request.action.name, - target: request.action.url, + target: request.action.action.postUrl || request.action.url, }; const signerStateActionContext: SignerStateDefaultActionContext< TSignerStorageType,