b3ce717c-9ee3-4c80-a3d1-de42f3563496 with the company name Apple, Inc and Stripe Customer ID cus_P5iEJpWPKP3xXI.
Tenant metadata is accessible via:
- API
- Job Lifecycle webhooks, except fields marked as
SecureString - Tenant configs, for use in your ETL scripts
- Config variables in Connector configuration
- The admin panel Tenant dashboard
How to add tenant metadata
Metadata is added per tenant. You can add any metadata field to any tenant. The API does not check metadata values against the schema, but the admin panel uses each schema field’s type when you add or edit that field. To list the fields your environment uses, set their types, and mark sensitive fields as secure, define a tenant metadata schema.Using the widget
Metadata can be added using the built-intenantMetadata option in the widget. When any widget function is called with a tenantMetadata option object, the tenant ID will be associated with your chosen metadata. This is supported in the Javascript widget (hotglue.com/widgetv2.js) or in React versions ≥ 1.4.9.
For example, you can add tenant metadata using the javascript HotGlue.link function as below:
🚧 Note: tenantMetadata overwrites existing metadata fields When you pass tenantMetadata to the widget, hotglue overwrites your metadata object with whatever is passed to the widget. If you do not pass all metadata values to the widget, this becomes a destructive action.
Using the API
Metadata can be added with a PUT to the/metadata endpoint. Learn more about tenant metadata APIs here.
Using the admin panel
Metadata can be added directly from the hotglue admin panel. To add metadata:- Navigate to the tenant management dashboard
- Click on any tenant (not the 👁 icon) to bring up the tenant management panel
- Navigate to the Metadata tab
- Type in a field name, type, and value
- Click
+to add your new metadata field
You can then configure which metadata is shown by clicking Edit Columns in your Tenant list, or edit metadata by clicking the pencil icon next to a field in your tenant management panel.
Define a tenant metadata schema
A tenant metadata schema is an optional, environment-wide list of metadata fields and their types. Each field has one of these types:
The schema shapes how metadata is displayed and edited in the admin panel and marks which fields are secure. The API and widget do not check values against the schema, and changing the schema does not change values already saved on tenants.
Define the schema in the admin panel
- Navigate to the tenant management dashboard.
- In your Tenant list, click the Table settings button to open the column menu.
- Under Schema, click Manage schema.
- Click Add field, enter a field name, and choose a type. Field names must be unique and cannot be empty.
- Click Save.
Boolean, a numeric input for Number, and a masked input for SecureString.
Define the schema with the API
Read the schema with a GET to/tenant/{env_id}/metadata/schema:
schema object maps each field name to an object with a type:
400 error when schema is missing or is not an object, when a field name is empty, or when a field’s type is not String, Number, Boolean, or SecureString.
If you remove a SecureString field from the schema or change its type, values already saved on tenants stay as they are, but they are no longer masked in the admin panel or removed from Job Lifecycle webhooks. Keep the field as SecureString until you remove those values from your tenants.
SecureString fields
Mark a field asSecureString when its value should not be shown or forwarded by default. For a SecureString field, hotglue:
- Masks the value in the admin panel. The Tenant list shows
***, and the Metadata tab hides the value until you click the eye icon. - Removes the field from the
tenant_metadataobject in Job Lifecycle webhooks.
hotglue_metadata.metadata, and can still be used as a config variable in Connector configuration.
You set a SecureString value the same way as any other metadata value, through the widget, API, or admin panel. Because hotglue matches secure fields by name, the field name in the tenant’s metadata must match the schema field name exactly.
Use metadata in config variables
Each tenant metadata field can be used as a config variable in Connector configuration. Write the field name in curly braces, exactly as it appears in the metadata, including spaces and capitalization. When a job runs, hotglue replaces the variable with that tenant’s value. For example, with this tenant metadata:exports/{Company}/{tenant} resolves to exports/acme/<tenant ID>, and a value of {Internal API Token} resolves to tok_123.
- Metadata fields named
tenant,tenant_id,root_tenant_id,sub_tenant_id,env_id,flow_id,job_id,external_job_id,tap, orconnectordo not replace the built-in value of that variable. - Empty strings,
false, and0are not substituted. The variable stays in the configuration as written. - Values are inserted as text. Use simple values that do not contain quotes or backslashes.
SecureStringfields are substituted like any other field.
Differences between tenant metadata vs. tenant config
Tenant metadata is stored in the tenant config. That means that you can technically utilize metadata in any way that you use the tenant config—for example, as flags in ETL scripts. Inside the tenant config, metadata is structured like below:tenant-config.json