This article covers:
First you need setup a service account to access BigQuery:
Go to Google Cloud Console and select IAM & admin tab from the left menu. Click on Service accounts from the list.

Click Create new service account and give it a name of your choice (eg. Luzmo Connector). Select BigQuery Connection User, BigQuery Job User, BigQuery Metadata Viewer and BigQuery Data Viewer from the role drop down.

Create a new "key".
Once created, you can then download a JSON with the credentials (the following example is not a valid key)

Navigate to the Connections page, select New Connection, then select the BigQuery from the New Connection modal. You'll be asked to provide a key and token. Copy these verbatim from the JSON file:

client-email as keyprivate-key as tokenPlease refer to the examples in our developer documentation to find out how to create a connection to BigQuery via our API.
Notes: To ensure that e.g. only the Luzmo application can access your Bigquery instance, it is highly recommended to whitelist Luzmo's range of static IP addresses. You should whitelist Luzmo's range of IP addresses as described here.
Once you have connected your BigQuery you can add datasets as explained here.
{{metadata.< parameter name >|< default value >}}. Find out more about parameterized SQL Datasets.Also make sure to check out this article on Preparing your data for analytics.
To find out how to add datasets using our API, please refer to the examples in our developer documentation.
When generating an Authorization token to grant a user acces to your embedded dashboards it is possible to override the data source properties in the authorization request to dynamically use different properties. Find out more about connection overrides.
The fields available for overriding a Bigquery connection are as follows:
\n characters in the token (i.e. \\n)bigquery_project_id:bigquery_dataset).Our developer documentation has more info about connection overrides and an examples of Bigquery connection overrides.
Example code demonstrating how to dynamically override a Bigquery connection to use a different Bigquery IAM service account when embedding:
import Luzmo from '@luzmo/nodejs-sdk';
const client = new Luzmo({
api_key: '<your Luzmo API key>',
api_token: '<your Luzmo API token>',
host: 'https://api.luzmo.com:443'
});
const response = await client.create('authorization',
{
type: "embed",
username: "< A unique and immutable identifier for your user >",
name: "< user name >",
email: "< user email >",
suborganization: "< a suborganization name >",
access: {
collections: [
{
id: "<collection_id>",
inheritRights: "use"
}
]
},
account_overrides: {
<your connection_id>: {
key: "new-email@test.iam.gserviceaccount.com",
token: "-----BEGIN PRIVATE KEY----- <obfuscated> -----\nEND PRIVATE KEY-----"
}
}
}
);
Example code demonstrating how to override the SQL query for a single Bigquery SQL dataset:
import Luzmo from '@luzmo/nodejs-sdk';
const client = new Luzmo({
api_key: '<your Luzmo API key>',
api_token: '<your Luzmo API token>',
host: 'https://api.luzmo.com:443'
});
const response = await client.create('authorization',
{
type: "embed",
username: "< A unique and immutable identifier for your user >",
name: "< user name >",
email: "< user email >",
suborganization: "< a suborganization name >",
access: {
collections: [
{
id: "<collection_id>",
inheritRights: "use"
}
]
},
account_overrides: {
<your connection_id>: {
datasets: {
< Luzmo dataset ID >: {
sql: "SELECT ... FROM ..."
}
}
}
}
}
);
| Data Type in Big Query | Data Type in Luzmo |
|---|---|
| BOOL | hierarchy |
| BOOLEAN | hierarchy |
| STRING | hierarchy |
| BYTES | hierarchy |
| TIME | hierarchy |
| NUMERIC | numeric |
| DECIMAL | numeric |
| BIGNUMERIC | numeric |
| BIGDECIMAL | numeric |
| INTEGER | numeric |
| INT64 | numeric |
| FLOAT64 | numeric |
| FLOAT | numeric |
| DATE | datetime |
| DATETIME | datetime |
| TIMESTAMP | datetime |