@forge/response
TypeScript icon, indicating that this package has built-in type declarations

0.2.3 • Public • Published

Forge response

This package provides response objects so that validation can occur within the invocation and related errors can be output to the app logs

AuthProfile

The AuthProfile object is useful for validating input given by the app user when going through the external Authentication flow.

By implementing this into the profile retriever function, if the input to the retriever is invalid, then the corresponding error will be output to the app's logs

Example

import { AuthProfile } from '@forge/response';

export const retriever = (body: string) => {
  const externalProfile = JSON.parse(body);

  return new AuthProfile({
    id: externalProfile.user.id,
    displayName: externalProfile.user.name,
    avatarUrl: externalProfile.user.avatar
  });
}

Readme

Keywords

none

Package Sidebar

Install

npm i @forge/response

Weekly Downloads

26

Version

0.2.3

License

UNLICENSED

Unpacked Size

5.05 kB

Total Files

9

Last publish

Collaborators

  • danwinterwijntjes
  • atlassian-cicd