Skip to content

Commit

Permalink
DOCS-3163: Update TS connection code (#3719)
Browse files Browse the repository at this point in the history
  • Loading branch information
npentrel authored Dec 2, 2024
1 parent 49b57ef commit 2979eb9
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 43 deletions.
14 changes: 7 additions & 7 deletions docs/how-tos/control-motor.md
Original file line number Diff line number Diff line change
Expand Up @@ -491,14 +491,14 @@ const main = async () => {

const machine = await VIAM.createRobotClient({
host,
credential: {
type: "api-key",
// Replace "<API-KEY>" (including brackets) with your machine's API key
payload: "<API-KEY>",
credentials: {
type: 'api-key'
/* Replace "<API-KEY>" (including brackets) with your machine's api key */,
payload: '<API-KEY>',
authEntity: '<API-KEY-ID>'
/* Replace "<API-KEY-ID>" (including brackets) with your machine's api key id */,
},
// Replace "<API-KEY-ID>" (including brackets) with your machine's API key ID
authEntity: "<API-KEY-ID>",
signalingAddress: "https://app.viam.com:443",
signalingAddress: 'https://app.viam.com:443',
});

button().onclick = async () => {
Expand Down
28 changes: 14 additions & 14 deletions docs/how-tos/drive-rover.md
Original file line number Diff line number Diff line change
Expand Up @@ -520,14 +520,14 @@ async function main() {

const machine = await VIAM.createRobotClient({
host,
credential: {
type: "api-key",
// Replace "<API-KEY>" (including brackets) with your machine's API key
payload: "<API-KEY>",
credentials: {
type: 'api-key'
/* Replace "<API-KEY>" (including brackets) with your machine's api key */,
payload: '<API-KEY>',
authEntity: '<API-KEY-ID>'
/* Replace "<API-KEY-ID>" (including brackets) with your machine's api key id */,
},
// Replace "<API-KEY-ID>" (including brackets) with your machine's API key ID
authEntity: "<API-KEY-ID>",
signalingAddress: "https://app.viam.com:443",
signalingAddress: 'https://app.viam.com:443',
});

button().onclick = async () => {
Expand Down Expand Up @@ -1017,14 +1017,14 @@ const main = async () => {

const machine = await VIAM.createRobotClient({
host,
credential: {
type: "api-key",
// Replace "<API-KEY>" (including brackets) with your machine's API key
payload: "<API-KEY>",
credentials: {
type: 'api-key'
/* Replace "<API-KEY>" (including brackets) with your machine's api key */,
payload: '<API-KEY>',
authEntity: '<API-KEY-ID>'
/* Replace "<API-KEY-ID>" (including brackets) with your machine's api key id */,
},
// Replace "<API-KEY-ID>" (including brackets) with your machine's API key ID
authEntity: "<API-KEY-ID>",
signalingAddress: "https://app.viam.com:443",
signalingAddress: 'https://app.viam.com:443',
});

button().onclick = async () => {
Expand Down
14 changes: 7 additions & 7 deletions docs/sdks/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,14 +212,14 @@ async function main() {

const robot = await VIAM.createRobotClient({
host,
credential: {
type: "api-key",
// Replace "<API-KEY>" (including brackets) with your machine's API key
payload: "<API-KEY>",
credentials: {
type: 'api-key'
/* Replace "<API-KEY>" (including brackets) with your machine's api key */,
payload: '<API-KEY>',
authEntity: '<API-KEY-ID>'
/* Replace "<API-KEY-ID>" (including brackets) with your machine's api key id */,
},
// Replace "<API-KEY-ID>" (including brackets) with your API key ID
authEntity: "<API-KEY-ID>",
signalingAddress: "https://app.viam.com:443",
signalingAddress: 'https://app.viam.com:443',
});

console.log("Resources:");
Expand Down
15 changes: 7 additions & 8 deletions docs/tutorials/control/air-quality-fleet.md
Original file line number Diff line number Diff line change
Expand Up @@ -438,14 +438,13 @@ The following instructions describe how to set up an API key for one location.

async function main() {
const opts: VIAM.ViamClientOptions = {
credential: {
type: "api-key",
// Key with location operator permissions
// Replace <API-KEY> (including angle brackets)
payload: "<API-KEY>",
// Replace <API-KEY-ID> (including angle brackets)
authEntity: "<API-KEY-ID>",
},
credentials: {
type: 'api-key'
/* Replace "<API-KEY>" (including brackets) with your machine's api key */,
payload: '<API-KEY>',
authEntity: '<API-KEY-ID>'
/* Replace "<API-KEY-ID>" (including brackets) with your machine's api key id */,
}
};

const orgID: string = "<ORGANIZATION ID>"; // Replace
Expand Down
14 changes: 7 additions & 7 deletions static/include/program/authenticate.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ const host = "ADDRESS FROM THE VIAM APP";

const robot = await VIAM.createRobotClient({
host,
credential: {
type: "api-key",
// Replace "<API-KEY>" (including brackets) with your machine's API key
payload: "<API-KEY>",
credentials: {
type: 'api-key'
/* Replace "<API-KEY>" (including brackets) with your machine's api key */,
payload: '<API-KEY>',
authEntity: '<API-KEY-ID>'
/* Replace "<API-KEY-ID>" (including brackets) with your machine's api key id */,
},
// Replace "<API-KEY-ID>" (including brackets) with your machine's API key ID
authEntity: "<API-KEY-ID>",
signalingAddress: "https://app.viam.com:443",
signalingAddress: 'https://app.viam.com:443',
});
```

Expand Down

0 comments on commit 2979eb9

Please sign in to comment.