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 | str | None | |
| logo_url | str | None | |
| color | str | None | |
| support_url | str | None | |
| email_from_name | str | None | |
| raw | dict[str, Any] | The response JSON exactly as the API sent it. |
| is_default | bool | True while nothing is set (the defaults are shown). |
| domain | str | None | Invite-only beta: the host your approval, question and hand-off pages are served from. |
| oauth_apps | dict[str, str] | |
| oauth_redirect_urls | dict[str, str] |
resetclassmethodasync
noclick.Brand.reset(*, client=None) -> BrandRemove the account's brand: pages and emails go back to the defaults.
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
None)NoClick's default brand, with is_default True.
brand = noclick.Brand.reset()
print(brand.is_default) # Truegetclassmethodasync
noclick.Brand.get(*, client=None) -> BrandRead the account's brand.
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
None)The brand your pages and emails show now; is_default is True while you haven't set one.
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
) -> BrandReplace 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.
NoneNoneNoneNoneNoneNoneThe client to send with; defaults to the module client built from NOCLICK_API_KEY.
None)The saved brand, with color lowercased and is_default False. A field you left out is now empty.
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
) -> BrandChange 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.
The client to send with; defaults to the module client built from NOCLICK_API_KEY.
None)The saved brand. A field you left out is unchanged.
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