@forge/response
v0.2.3
Published
Contains object to do validation of response objects at time of invocation
Downloads
6
Keywords
Readme
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
});
}