# Snowflake

### How can I connect Snowflake to Relay.app?

* In a SQL file, create a new security integration by running the following

```
CREATE OR REPLACE SECURITY INTEGRATION relay_app_integration
  TYPE = OAUTH
  ENABLED = TRUE
  OAUTH_CLIENT = CUSTOM
  OAUTH_CLIENT_TYPE = 'CONFIDENTIAL'
  OAUTH_REDIRECT_URI = 'https://run.relay.app/connect/callback/snowflake'
  OAUTH_ISSUE_REFRESH_TOKENS = TRUE
  OAUTH_SINGLE_USE_REFRESH_TOKENS_REQUIRED = TRUE
  OAUTH_REFRESH_TOKEN_VALIDITY = 7776000;
```

* Run the following to reveal the Oauth secrets which Relay.app will need to connect

```
SELECT SYSTEM$SHOW_OAUTH_CLIENT_SECRETS('RELAY_APP_INTEGRATION');
```

Finally, retrieve the instance URL from the 'accounts' settings page:

<figure><img src="https://647519108-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXkKoEy3xMIYaIwd4mRAB%2Fuploads%2Fgit-blob-2bc70910261e5d3fb1f77013f89749db5cccd6f8%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://647519108-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXkKoEy3xMIYaIwd4mRAB%2Fuploads%2Fgit-blob-1b37a8b5343bc1a9fe880029938c6a3cd6f0c296%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

* Finally, enter these pieces of information into the Relay.app connection dialog and click **connect**
