Brand

Brand: how your product appears on the pages and emails NoClick sends for you, and the OAuth apps your users connect with.

class Brand

One 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.

Attributes
namestr | None
logo_urlstr | None
colorstr | None
support_urlstr | None
email_from_namestr | None
rawdict[str, Any]

The response JSON exactly as the API sent it.

is_defaultbool

True while nothing is set (the defaults are shown).

domainstr | None

Invite-only beta: the host your approval, question and hand-off pages are served from.

oauth_appsdict[str, str]
oauth_redirect_urlsdict[str, str]

resetclassmethodasync

noclick.Brand.reset(*, client=None) -> Brand

Remove the account's brand: pages and emails go back to the defaults.

Parameters
clientClient | None

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

(default None)
Returns
Brand

NoClick's default brand, with is_default True.

Usage
brand = noclick.Brand.reset()
print(brand.is_default)   # True

getclassmethodasync

noclick.Brand.get(*, client=None) -> Brand

Read the account's brand.

Parameters
clientClient | None

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

(default None)
Returns
Brand

The brand your pages and emails show now; is_default is True while you haven't set one.

Usage
brand = noclick.Brand.get()
print(brand.name, brand.color, brand.is_default)

setclassmethodasync

noclick.Brand.set(
    *, name=None, logo_url=None, color=None, support_url=None, email_from_name=None,
    domain=None, oauth_apps=None, client=None
) -> Brand

Replace the account's brand with these fields (color as "#RRGGBB", or "#RGB"); a field left out is cleared. To change one field and keep the rest, use update.

oauth_apps maps a provider (google, slack, box, ...) to an account Secret (or its id or name) holding CLIENT_ID and CLIENT_SECRET of your own OAuth app there, so the consent screen your users see names you; register the provider's oauth_redirect_urls entry as the app's redirect URI. Connect links made after it is set sign in with that app, and each connection keeps the app it was made with, refreshing on it too: connections made before keep NoClick's until they're reconnected. A provider NoClick can't sign in to with your own app yet raises noclick.InvalidRequest naming those it can.

Invite-only beta: domain (a Domain your account holds, or its name, such as connect.acme.com) serves the approval, question and hand-off pages NoClick shows your users from your own host, and the emails that bring people there link to it and name only your brand (they come from NoClick's address under email_from_name; connect links stay on NoClick's host for now). It takes one CNAME record, which a bought domain gets at once and a connected one lists in records; the domain's serves then includes brand.

Parameters
namestr | Nonedefault None
logo_urlstr | Nonedefault None
colorstr | Nonedefault None
support_urlstr | Nonedefault None
email_from_namestr | Nonedefault None
domainAnyinvite-only betadefault None
oauth_appsMapping[str, Any] | Nonedefault None
clientClient | None

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

(default None)
Returns
Brand

The saved brand, with color lowercased and is_default False. A field you left out is now empty.

Usage

Show your name, logo and colour:

noclick.Brand.set(
    name="Acme",
    logo_url="https://acme.com/logo.png",
    color="#FF5500",
    support_url="https://acme.com/help",
    email_from_name="Acme Support",
)

Ask for Google access with your own app. Create it with the redirect URI from Brand.get().oauth_redirect_urls["google"], put its client id and secret in a secret, then name it:

noclick.Brand.set(
    name="Acme",
    logo_url="https://acme.com/logo.png",
    oauth_apps={"google": noclick.Secret.from_name("google-oauth-app")},
)

Serve the pages from your own host (invite-only beta):

noclick.Brand.set(name="Acme", domain="connect.acme.com")

updateclassmethodasync

noclick.Brand.update(
    *, name=..., logo_url=..., color=..., support_url=..., email_from_name=...,
    domain=..., oauth_apps=..., client=None
) -> Brand

Change only the fields you pass; the rest stay as they are. None clears a field. set replaces the whole brand instead. oauth_apps changes only the providers it names (links made after for a provider mapped to None sign in with NoClick's app), and oauth_apps=None removes them all. domain is as in set (invite-only beta). Before you've set a brand, it changes NoClick's default one: the name stays NoClick until you give it yours.

Parameters
nameAnyomit to leave it unchanged
logo_urlAnyomit to leave it unchanged
colorAnyomit to leave it unchanged
support_urlAnyomit to leave it unchanged
email_from_nameAnyomit to leave it unchanged
domainAnyinvite-only betaomit to leave it unchanged
oauth_appsAnyomit to leave it unchanged
clientClient | None

The client to send with; defaults to the module client built from NOCLICK_API_KEY.

(default None)
Returns
Brand

The saved brand. A field you left out is unchanged.

Usage
noclick.Brand.update(color="#FF5500")    # the name, logo and the rest are kept
noclick.Brand.update(support_url=None)   # no support link from now on
noclick.Brand.update(oauth_apps={"slack": noclick.Secret.from_name("slack-oauth-app")})   # Google's stays
noclick.Brand.update(oauth_apps={"google": None})   # new Google links use NoClick's app