Frog.castAction Response
The response returned from the .castAction handler.
import { Frog } from 'frog'
 
export const app = new Frog()
 
app.castAction('/', (c) => {
  return c.res({
    // ...
  })
})headers
- Type: 
Record<string, string> 
HTTP response headers to set for the action.
import { Button, Frog } from 'frog'
 
export const app = new Frog()
 
app.castAction('/action/foo', (c) => {
  return c.res({
    headers: {
      'Cache-Control': 'max-age=0',
    },
    message: 'Success!',
    statusCode: 200,
  })
})message
- Type: 
string 
Message to show in the toast in the App that sent the action.
/** @jsxImportSource frog/jsx */
// ---cut---
import { Button, Frog } from 'frog'
 
export const app = new Frog()
 
app.castAction('/', (c) => {
  return c.res({
    message: 'Action Succeeded!',
    statusCode: 200,
  })
})link
- Type: 
string | undefined 
An optional URL. Must be http:// or https:// protocol. If present, clients must display the message as an external link to this URL.
/** @jsxImportSource frog/jsx */
// ---cut---
import { Button, Frog } from 'frog'
 
export const app = new Frog()
 
app.castAction('/', (c) => {
  return c.res({
    message: 'Action Succeeded!',
    link: 'https://frog.fm',
    statusCode: 200,
  })
})statusCode
- Type: 
200 | ClientErrorStatusCode | undefined - Default: 
200. 
HTTP Status code to respond with.
/** @jsxImportSource frog/jsx */
// ---cut---
import { Button, Frog } from 'frog'
 
export const app = new Frog()
 
app.castAction('/', (c) => {
  return c.res({
    message: 'Action Succeeded!',
    statusCode: 200,
  })
})