--- title: "SDK Methods" slug: "sdk-methods" status: "update" updated: 2026-09-15T16:09:51Z published: 2026-09-15T16:09:51Z canonical: "docs.bigid.com/sdk-methods" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.bigid.com/llms.txt > Use this file to discover all available pages before exploring further. # SDK Methods Under `window.bigidcmp` you will find the following API: ### setLanguage[​](/consent/docs/sdk-methods#setlanguage) This method changes the language used in the banner. It fires the [bigidcmp:language_changed](/consent/docs/sdk-events) event. `setLanguage(language)` | Parameter | Required | Values | Description | | --- | --- | --- | --- | | language | Yes | 'ar', 'bg', 'cs', 'da', 'de', 'el', 'en', 'en-gb', 'es', 'fi', 'fr', 'he', 'hr', 'hu', 'it', 'nb', 'nl', 'pl', 'pt', 'pt-pt', 'ro', 'ru', 'sk', 'sl', 'sr', 'sv', 'th', 'tr', 'ua', 'ca', 'fr-ca' | ISO Code for the language to be used in the banner. | ```json window.bigidcmp.setLanguage('de'); ``` ### getConsent[​](/consent/docs/sdk-methods#getconsent) This method obtains the consent state. `getConsent()` Returns object with: | Property | Required | Values | Description | | --- | --- | --- | --- | | consent-id | Yes | string | ID for the consent. | | marketing | Yes | boolean | Whether consent for marketing tools is enabled or not. | | preferences | Yes | boolean | Whether consent for preferences tools is enabled or not. | | statistics | Yes | boolean | Whether consent for statistics tools is enabled or not. | | optedIn | Yes | boolean | Only present in US opt-out model. True, if "Don't sell my data" is off. False otherwise. | | userId | No | string | The user ID for the consent if the user was identified. | ```json window.bigidcmp.getConsent(); ``` ### setConsent[​](/consent/docs/sdk-methods#getconsent) This method modifies or creates a new the consent state. It fires the [bigidcmp:consent_set](/consent/docs/sdk-events) event. `setConsent(consent, enableStore)` | Parameter | Required | Values | Description | | --- | --- | --- | --- | | consent | Yes | Consent | Whether consent for marketing tools is enabled or not. | | enableStore | No | boolean | Whether the consent will be stored or not. Set it to false, **only** if you just want to disable the banner’s blocking capabilities without logging the consent. Default value is **true**. | **Consent (object):** | Parameter | Required | Values | Description | | --- | --- | --- | --- | | marketing | Yes | boolean | Whether consent for marketing tools is granted or not. | | preferences | Yes | boolean | Whether consent for preferences tools is granted or not. | | statistics | Yes | boolean | Whether consent for statistics tools is granted or not. | | optedIn | No | boolean | Only present in opt-out model. True, if "Don't sell my data" is off. False otherwise. | ```json window.bigidcmp.setConsent({  marketing: true,  preferences: false,  statistics: true, }); ``` ### showWidget[​](/consent/docs/sdk-methods#showwidget) This method opens the consent widget. If using the US opt-out model + Notice mode, the "Don't sell my data" notice will be shown. If not, the banner will be rendered. It fires the [bigidcmp:widget_opened](/consent/docs/sdk-events) event. `showWidget()` ```json window.bigidcmp.showWidget(); ``` ### identify[​](/consent/docs/sdk-methods#identify) This method identifies the consent with the User ID sent. It makes the consent cross-device. Check the [Authenticated Visitor Use Case](/consent/docs/authenticated-visitor). It fires the [bigidcmp:identity_added](/consent/docs/sdk-events) event. `identify(userId)` | Parameter | Required | Values | Description | | --- | --- | --- | --- | | userId | Yes | string | The ID for the user you are identifying. It is managed by you. | ```json window.bigidcmp.identify('123'); ``` ### removeIdentity[​](/consent/docs/sdk-methods#removeidentity) This method removes the identity being used. It makes BigID use an anonymous consent again. Check the [Authenticated Visitor Use Case](/consent/docs/authenticated-visitor). It fires the [bigidcmp:identity_removed](/consent/docs/sdk-events) event. `removeIdentity()` ```json window.bigidcmp.removeIdentity(); ``` ### refreshWidget[​](/consent/docs/sdk-methods#refreshwidget) This method refreshes the UI of the widget. It fires the [bigidcmp:widget_refreshed](/consent/docs/sdk-events) event. `refreshWidget()` ```json window.bigidcmp.refreshWidget(); ``` ### googleConsentMode.examine[​](/consent/docs/sdk-methods#googleconsentmodeexamine) This method examines whether a `default` or `update` consent command of [Google Consent Mode](https://support.google.com/google-ads/answer/10000067) was set before any tag loads or not. It returns the following object: ```json interface Result {  loadedOnTime: boolean;  previousEvents: Array; }; ``` If the property `loadedOnTime` is set to true, then the implementation is correctly done. Otherwise, the property `previousEvents` will have a list of all the `dataLayer` events fired before the Google Consent Mode is properly initialized. This array will give you hints of the tags that are being fired before BigID's banner has the chance to set the consent types as it should. If `loadedOnTime` is set to false and yet `previousEvents` is empty, then the tags being fired before Google Consent Mode is initialized are probably being wrongly configured in [Google Tag Manager](https://tagmanager.google.com/). Preview your website with [Google Tag Assistant](https://tagassistant.google.com/) and you should see the next error message under the `Consent` tab: ![Tag Assitant Error](https://cdn.us.document360.io/a1b4dbb6-204b-4038-905b-11451e3058a8/Images/Documentation/tag-assistant-consent-error.png?sv=2026-02-06&spr=https&st=2026-10-12T12%3A43%3A11Z&se=2026-10-12T13%3A43%3A11Z&sr=c&sp=r&sig=Hh49kueWYG8PD%2FMyBJb9AjvLTPVUIQVk1ptmfnc%2FBzs%3D) `googleConsentMode.examine()` ```json window.bigidcmp.googleConsentMode.examine(); ```