Skip to main content
A Brand Kit is the look the AI gives every widget it builds: a palette, a font for each kind of text, a corner radius, a few style notes of your own, and the icons and font files you upload. Until you save one, widgets are built with Widgetic’s default kit. Save yours once and everything your account makes from then on follows it.
  • It belongs to your account, the one your API key was made for, and it is the default for every widget the AI builds there. A customer’s editor session acts as your account, so what a customer builds in the widget creator you embed is built with your kit, and your customers need no kit of their own.
  • There is one kit for your whole account, not one per customer. A managed user is a label on what you make, not an account. A call made for one managed user (with the X-Managed-User-Id header) is not accepted on these routes: it is refused with 403 and MANAGED_USER_SCOPE_ROUTE_NOT_AVAILABLE.
  • It is never part of a widget’s content. A kit decides how a widget looks, not what is in it: it never adds a title, a button or a photo to a widget.
The examples on this page are for your server. Keep the key in an environment variable, such as WIDGETIC_PARTNER_KEY.

What a Kit Holds

Widgetic’s default kit is a green palette (Forest #314F2F, Sage #7BA668, Sunny #F5CE5A, Coral #F55A5A, and white, mist and ink for the background, surfaces and text), Inter for every text, corner radii of 8, 12 and 15 px, and the style note “Widget backgrounds to be white whenever possible.”

What You Need

An API key. Looking at the kit needs the account:read scope. Changing it needs a key with full access, because a change reshapes every widget your account makes from then on. See Authentication.

Whose Kit a Key Works

  • A key made for your account works your account’s kit. This is the case for a partner’s key.
  • A key made for a team works the team’s kit, and no other: naming another team with it is refused (403, not_a_member). To change the team’s kit, the person the key acts as has to be allowed to manage the team’s settings (403, not_allowed_to_edit otherwise).
  • A key of a person’s own account may name one of that person’s teams with the organizationId query parameter (GET /brand-kit?organizationId=...), when the person is an active member of it.
  • A managed user has no kit. See above.

Read Your Kit

The answer is always a whole kit, trimmed here. The fields to know:

Change Parts of It

PATCH /brand-kit changes the parts you send and leaves the rest as it was. This is the call to use for almost everything. Send at least one of colors, fonts, cornerRadius, spacing or instructions:
The answer is the kit as it is now. What each part does when you send it:
  • colors replaces the whole palette. To add a color, read the kit, add it to the list and send the list. An empty list goes back to Widgetic’s default palette.
  • fonts changes the roles you name and leaves the others. Send the whole font for a role (family, source and, if you like, weight).
  • cornerRadius is one number. See Corner Radius.
  • spacing changes the steps you name: xs, s, m, l and xl (0 to 128 px) and the three radii radiusS, radiusM and radiusL (0 to 64 px). A radius step you send in spacing wins over the one made from cornerRadius.
  • instructions are your style notes; an empty string removes them.
  • expectedVersion refuses the change with 409 (brand_kit_version_conflict) when the kit was saved again since you read that version.
Two parts of a request are checked together: each color value and each role may appear once in colors, and a font you upload has to exist before a role uses it (see below). PUT /brand-kit replaces the colors, fonts, spacing and notes with exactly what you send, in a body of the form { "tokens": { "colors": [], "fonts": {}, "spacing": { ... }, "instructions": "..." } } with every spacing step present. Use it to copy a kit from one environment to another; use PATCH to change one thing.

Your Own Fonts

Upload the file, then name its family in a role. A font file is a woff2, woff, ttf or otf file of at most 3 MB, and a kit holds up to 12 of them.
family and weight (100 to 900, in hundreds) are required, and style is normal (the default) or italic. The answer is the kit, with the file in assets, and the call answers 201. A family, weight and style can be uploaded once (409, font_variant_exists). Then use it:
A role that names an uploaded family with no file in the kit is refused with 400: upload first.

Your Own Icons

An icon is a name and an SVG. The name says what the icon means (cart, menu, arrow-right): a widget that needs that icon takes yours, by name, in place of a general-purpose one.
The SVG is rewritten before it is kept: scripts, event handlers and links to other files are removed, and a file that is not a well-formed SVG is refused with 422 (svg_rejected). It may weigh up to 32 KB, a name is up to 48 letters, digits, spaces, hyphens or underscores and is used once in the kit (409, icon_name_taken), and a kit holds up to 100 icons. A widget draws the icon inline, so a part of it drawn with currentColor takes the color of the text around it: draw an icon that way if it should follow the widget’s colors.

Rename or Remove a Font or an Icon

Every file and icon has an id in assets:
Removing a font or an icon puts Widgetic’s own back. A role that used the font you removed goes back to Inter, and a widget that is built or revised after that uses a default Widgetic icon where yours was. A widget that is already built keeps what it was built with until it is revised.

Style Notes

instructions is a few lines in your own words that the AI reads for every widget, next to the palette and the fonts. They are for how a widget looks, so write them as a design rule:
  • Use the dark color as the background always and the light color for titles.
  • Flat design: no shadows, no gradients.
  • Backgrounds white whenever possible; the primary color only for buttons.
Widgetic’s own note, which a kit keeps until its owner writes another, is Widget backgrounds to be white whenever possible. Send your own to replace it, or an empty string ("") to have none. Notes are only about how a widget looks. They add no element to a widget and never change what a request asks for, and where a request says something different, the request wins. A note that asks for anything but styling, such as another output format or hidden text, is not followed.

Corner Radius

cornerRadius is one number: the radius of a card, in pixels. The small and the large radii of a widget are made from it, so one value is enough to make a whole kit round or square: Pass spacing.radiusS, spacing.radiusM or spacing.radiusL as well when you want one of the three to differ from what the number makes.

How a Widget Uses the Kit

  • A request wins over the kit. When the person who asks for a widget names a color, a font or a look in their request (“a red button”, “use Georgia”), the widget follows the request, and the kit fills in everything the request left open.
  • At most two palette colors at a time. Besides the background and the text, a widget shows no more than two colors of the palette together, and text is set in the dark color, so a widget looks like one brand and not like the whole palette.
  • Text is readable. The AI pairs colors from a table of their contrast (WCAG), and does not set text on a background that gives less than 4.5:1. A palette that cannot give that, such as light-grey text on white, is saved as you sent it and comes back with a line in warnings:
  • A change reaches new work only. A widget is made with the kit as it is when it is built or revised. Widgets that already exist, and the ones already published, keep their look until someone revises them.

Go Back to the Default

This removes your colors, fonts, notes, uploaded font files and icons, and the answer is Widgetic’s default kit (isDefault: true). Widgets that already exist are not touched.

Limits

Errors

The answer is the usual error body; the code tells which:

Other Ways to Set the Same Kit

A kit is one thing with several doors:
  • The account holder can set it on widgetic.com, under Settings, Brand Kit, where colors, fonts and icons are shown, and where a Figma design link can be read into a draft.
  • A person who connects an AI assistant to Widgetic can ask it to read or change their own kit: see the get_brand_kit and update_brand_kit tools.
  • Each call above is a command of the Widgetic CLI and a method of the SDKs, so a script can set the kit from a deploy.