Brand
Brand: how your product appears on the pages and emails NoClick sends for you, and the OAuth apps your users connect with.
class BrandOne per account; rendered on /h/ pages and human emails. oauth_apps names your
own OAuth app per provider, as {provider: secret id}. oauth_redirect_urls has the
redirect URI to register with your app at every provider you can bring one for, as
{provider: url}: you need it to create the app, before it is named here.
| name | string | null | |
| logoUrl | string | null | |
| color | string | null | |
| supportUrl | string | null | |
| emailFromName | string | null | |
| raw | JsonObject | The response JSON exactly as the API sent it. |
| isDefault | boolean | True while nothing is set (the defaults are shown). |
| domain | string | null | The host your approval, question and hand-off pages are served from; null: NoClick's. |
| oauthApps | Record<string, string> | Your own OAuth app per provider, as |
| oauthRedirectUrls | Record<string, string> | The redirect URI to register with your app at every provider you can bring one for, as
|
type JsonObject = { [key: string]: unknown };resetstatic
static reset(options?: { client?: NoClick }): Promise<Brand>Remove the account's brand: pages and emails go back to the defaults (returned, isDefault true).
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
NoClick's default brand, with is_default True.
getstatic
static get(options?: { client?: NoClick }): Promise<Brand>Read the account's brand.
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
The brand your pages and emails show now; is_default is True while you haven't set one.
setstatic
static set(fields: BrandFields, options?: { client?: NoClick }): Promise<Brand>Replace the brand: fields left out are cleared. To change one field, use update.
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
The saved brand, with color lowercased and is_default False. A field you left out is now empty.
interface BrandFields {
name?: string | null;
logoUrl?: string | null;
/** The pages' accent, as `#RRGGBB` (or `#RGB`); kept as lowercase `#rrggbb`. */
color?: string | null;
supportUrl?: string | null;
emailFromName?: string | null;
/**
* A domain your account holds (a `Domain` or its name, like `connect.acme.com`) that serves the
* approval, question and hand-off pages NoClick shows your users, and that the emails bringing them
* there link to (they come from NoClick's address under `emailFromName`; connect links stay on
* NoClick's host for now). A bought domain gets its CNAME at once; a connected one lists the records
* to add in its `records`: the CNAME, and a TXT that proves the name is yours. The domain's
* `serves` then includes `brand`. `null` moves the pages back to NoClick's host.
*/
domain?: string | Domain | null;
/**
* Your own OAuth app per provider (`google`, `slack`, `box`, ...): an account `Secret` (or its id
* or name) holding `CLIENT_ID` and `CLIENT_SECRET`, so the consent screen names you. Register the
* provider's `oauthRedirectUrls` entry with the app. Connect links made after it is set sign in
* with it and each connection keeps (and refreshes on) the app it was made with, so connections
* made before keep NoClick's until they're reconnected. On `update` only the providers named
* change (links made after for one mapped to `null` sign in with NoClick's app), and
* `oauthApps: null` removes them all.
*/
oauthApps?: Record<string, SecretRef | null> | null;
}
/** A secret to pass: a `Secret`, its id, or its name (the user's own, else the account's). */
type SecretRef = string | Secret;updatestatic
static update(
fields: BrandFields,
options?: { client?: NoClick },
): Promise<Brand>Change only the fields you pass; the rest stay as they are. null clears a field. Before you've
set a brand, it changes NoClick's default one: the name stays NoClick until you give it yours.
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
The saved brand. A field you left out is unchanged.
interface BrandFields {
name?: string | null;
logoUrl?: string | null;
/** The pages' accent, as `#RRGGBB` (or `#RGB`); kept as lowercase `#rrggbb`. */
color?: string | null;
supportUrl?: string | null;
emailFromName?: string | null;
/**
* A domain your account holds (a `Domain` or its name, like `connect.acme.com`) that serves the
* approval, question and hand-off pages NoClick shows your users, and that the emails bringing them
* there link to (they come from NoClick's address under `emailFromName`; connect links stay on
* NoClick's host for now). A bought domain gets its CNAME at once; a connected one lists the records
* to add in its `records`: the CNAME, and a TXT that proves the name is yours. The domain's
* `serves` then includes `brand`. `null` moves the pages back to NoClick's host.
*/
domain?: string | Domain | null;
/**
* Your own OAuth app per provider (`google`, `slack`, `box`, ...): an account `Secret` (or its id
* or name) holding `CLIENT_ID` and `CLIENT_SECRET`, so the consent screen names you. Register the
* provider's `oauthRedirectUrls` entry with the app. Connect links made after it is set sign in
* with it and each connection keeps (and refreshes on) the app it was made with, so connections
* made before keep NoClick's until they're reconnected. On `update` only the providers named
* change (links made after for one mapped to `null` sign in with NoClick's app), and
* `oauthApps: null` removes them all.
*/
oauthApps?: Record<string, SecretRef | null> | null;
}
/** A secret to pass: a `Secret`, its id, or its name (the user's own, else the account's). */
type SecretRef = string | Secret;