メインコンテンツまでスキップ

Connect a client

Connect to a Database with any standard Valkey or Redis client through the shared gateway. Use these connection details:

  • Host: the pool's gateway endpoint
  • Port: 6379, TLS enabled
  • Username: your Database name
  • Password: a Momento API token

Check Valkey compatibility for the supported commands before you port a workload. Below are examples with some of the most common clients.

valkey-cli

valkey-cli -h <endpoint> -p 6379 --tls \
--user <database-name> --pass <api-token>

Node.js (ioredis)

import Redis from "ioredis";

const client = new Redis({
host: "<endpoint>",
port: 6379,
tls: {},
username: "<database-name>",
password: "<api-token>",
});

Python (redis-py)

import redis

client = redis.Redis(
host="<endpoint>",
port=6379,
ssl=True,
username="<database-name>",
password="<api-token>",
)

Go (go-redis)

client := redis.NewClient(&redis.Options{
Addr: "<endpoint>:6379",
TLSConfig: &tls.Config{},
Username: "<database-name>",
Password: "<api-token>",
})