⚡️ Introducing Custom UI: Static HTML/CSS/JS frontends on Forge

Hey @naiara,

Context information is available in the custom UI resolvers. If you do need this information in the UI itself, you can return it from the function. See the following example:

In your FaaS function:

resolver.define("example-key", ({ payload, context }) => {
  console.log(context);

  return { example: `Hello, ${payload.foo}!` };
});

In your custom UI:

import { invoke } from '@forge/bridge';

const getData = async () => {
  const result = await invoke('example-key', { foo: 'bar' });

  console.log(result);
}

If you have a use case that this doesn’t cover, don’t hesitate to reach out :slight_smile:

1 Like