Connect a client
Connect to a Database with any standard Valkey or Redis client through the shared gateway. Use these connection details:
- Host: the region's RESP endpoint (shared by Databases in that region)
- Port:
6379, TLS enabled - Username: your Database name
- Password: a Momento API token
In the private-preview console, open Capacity Pools, select the Pool, and copy the RESP endpoint from its Databases tab. The endpoint is shared by every Database in that region. Retrieve the credential separately through Key Management; the Database tab does not vend one.
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>",
})