JavaScript

Créez votre Applications Vonage

Au cours de cette étape, vous allez créer un compte Vonage Applications capable de répondre à des cas d'utilisation de la communication par In-App Messaging.

Ouvrez une nouvelle fenêtre de terminal et créez un répertoire de projet dans une destination de votre choix, puis accédez-y :

mkdir vonage-tutorial cd vonage-tutorial

Créez une application Vonage en copiant et en collant la commande ci-dessous dans le terminal :

vonage apps create 'Your application'

✅ Creating Application
Saving private key ... Done!
Application created

Name: Your application
Application ID: 00000000-0000-0000-0000-000000000000
Improve AI: Off
Private/Public Key: Set

Capabilities:
  None Enabled
vonage apps create 'Your application'

✅ Creating Application
Saving private key ... Done!
Application created

Name: Your application
Application ID: 00000000-0000-0000-0000-000000000000
Improve AI: Off
Private/Public Key: Set

Capabilities:
  None Enabled
vonage apps create 'Your application' ✅ Creating Application Saving private key ... Done! Application created Name: Your application Application ID: 00000000-0000-0000-0000-000000000000 Improve AI: Off Private/Public Key: Set Capabilities: None Enabled

Maintenant que votre application Vonage a été créée, mettez à jour votre authentification CLI avec l'ID de l'application et la clé privée :

vonage auth set `
--local `
--api-key='your-api-key' `
--api-secret='your-api-secret' `
--app-id='your-application-id' `
--private-key=C:\path\to\private.key

API Key: your-api-key
API Secret: your-**************
App ID: your-application-id
Private Key: Is Set

✅ Checking API Key Secret
✅ Checking App ID and Private Key
vonage auth set ^
--local ^
--api-key='your-api-key' ^
--api-secret='your-api-secret' ^ 
--app-id='your-application-id' ^
--private-key=C:\path\to\private.key

API Key: your-api-key
API Secret: your-**************
App ID: your-application-id
Private Key: Is Set

✅ Checking API Key Secret
✅ Checking App ID and Private Key
vonage auth set \ --local \ --api-key='your-api-key' \ --api-secret='your-api-secret' \ --app-id='your-application-id' \ --private-key=/path/to/private.key API Key: your-api-key API Secret: your-************** App ID: your-application-id Private Key: Is Set ✅ Checking API Key Secret ✅ Checking App ID and Private Key

Les webhooks concernant les événements de votre conversation peuvent être envoyés à votre rtc-event-url. Nous ne les utiliserons pas dans ce tutoriel, il suffit donc d'utiliser un exemple d'URL avec cette commande pour activer le RTC sur votre Application Vonage. Veillez à remplacer l'identifiant de l'application Vonage dans la commande par celui que vous avez créé plus tôt :

vonage apps capabilities update 00000000-0000-0000-0000-000000000000 messages `
  --messages-inbound-url='https://example.com/messages/inboud' `
  --messages-status-url='https://example.com/messages/status' `
  --messages-version='v1' `
  --no-messages-authenticate-media
  
✅ Fetching Application
✅ Adding messages capability to application 00000000-0000-0000-0000-000000000000

Name: Your application
Application ID: 00000000-0000-0000-0000-000000000000
Improve AI: Off
Private/Public Key: Set

Capabilities:
  MESSAGES:
    Authenticate Inbound Media: Off
    Webhook Version: v1
    Status URL: [POST] https://example.com/messages/status
    Inbound URL: [POST] https://example.com/messages/inboud
vonage apps capabilities update 00000000-0000-0000-0000-000000000000 messages ^
  --messages-inbound-url='https://example.com/messages/inboud' ^
  --messages-status-url='https://example.com/messages/status' ^
  --messages-version='v1' ^
  --no-messages-authenticate-media
  
✅ Fetching Application
✅ Adding messages capability to application 00000000-0000-0000-0000-000000000000

Name: Your application
Application ID: 00000000-0000-0000-0000-000000000000
Improve AI: Off
Private/Public Key: Set

Capabilities:
  MESSAGES:
    Authenticate Inbound Media: Off
    Webhook Version: v1
    Status URL: [POST] https://example.com/messages/status
    Inbound URL: [POST] https://example.com/messages/inboud
vonage apps capabilities update 00000000-0000-0000-0000-000000000000 rtc \ --rtc-event-url='https://example.com/webhooks/rtc/fallback' ✅ Fetching Application ✅ Adding rtc capability to application 00000000-0000-0000-0000-000000000000 Name: Your application Application ID: 00000000-0000-0000-0000-000000000000 Improve AI: Off Private/Public Key: Set Capabilities: RTC: Event URL: [POST] https://example.com/webhooks/voice/rtc Uses Signed callbacks: Off

NOTE : Des informations sur votre application, y compris l'identifiant de l'application, peuvent également être trouvées dans la section Tableau de bord.