Zum Inhalt springen

App-Deskriptor

Der App-Deskriptor ist eine JSON-Datei, normalerweise manifest.json, die Crowdin mitteilt, was die App ist und welche Module sie hinzufügt.

Crowdin App integration

Der App-Deskriptor ist ein JSON-Objekt. Eine selbst gehostete App stellt sie über ihren eigenen Server bereit, während eine serverlose App sie im Projekt speichert und mit der CLI an Crowdin überträgt.

manifest.json
{
"identifier": "your-application-identifier",
"name": "Your Application",
"description": "Application description",
"logo": "/assets/logos/app-logo.png",
"baseUrl": "http://example.com",
"authentication": {
"type": "crowdin_app",
"clientId": "your-client-id"
},
"events": {
"installed": "/hooks/installed"
},
"scopes": [
"project"
],
"modules": {
"project-integrations": [
{
"key": "your-module-key",
"name": "Module Name",
"description": "Module description",
"logo": "/assets/logos/module-logo.png",
"url": "/page/integration",
"environments": [
"crowdin", "crowdin-enterprise"
]
}
]
}
}

Ein serverloser Deskriptor enthält kein baseUrl, deklariert UI-Module ohne url und lässt events weg, die auf URLs auf einem eigenen Server verweisen.

manifest.json
{
"identifier": "your-application-identifier",
"name": "Your Application",
"description": "Application description",
"bundle": {
"mode": "internal"
},
"scopes": [
"project"
],
"modules": {
"project-menu": [
{
"key": "your-module-key",
"name": "Module name"
}
]
}
}
PropertyBeschreibung
identifier

Typ: string

Erforderlich: ja

Beschreibung: A eindeutig key to identifizieren the App, 255 Zeichen oder fewer.

name

Typ: string

Erforderlich: ja

Beschreibung: The human-readable Name of the App.

baseUrl

Typ: string (uri)

Erforderlich: ja (selbst gehostet Apps nur)

Beschreibung: The base URL of the remote App, verwendet für all communication back to it. A descriptoder ohne a baseUrl describes a Serverlos App, die Crowdin hosts und läuft.

bundle

Typ: object

Beschreibung: Serverless Apps nur. Where Crowdin serves the App von. Set mode to internal für the Bundle uploaded to Crowdin, oder to external mit a url that points to a lokal Entwicklung Server.

authentication

Typ: Authentication

Beschreibung: The authentication Typ verwendet wenn signing Anfrages between Crowdin und the App. Defaults to none, die is the Typ Serverlos Apps use.

description

Typ: string

Beschreibung: The human-readable Beschreibung of was the App does. Es ist sichtbar in the Crowdin UI.

logo

Typ: string (relativeUri)

Beschreibung: Die Bild-URL relative to the App’s base URL, angezeigt in the Crowdin UI.

events

Typ: Events

Beschreibung: Callbacks für App event neintwennications (selbst gehostet Apps nur).

scopes

Typ: [string, … ]

Erforderlich: ja

Beschreibung: Set of scopes Anfrageed by this App.

modules

Typ: object

Erforderlich: ja

Beschreibung: The list of Modul this App bietet. Serverless Apps bieten UI Modul.

default_Berechtigungen

Typ: object

Beschreibung: Who can use the App right nach Installation. user accepts owner, managers, all, oder guests, und project accepts own oder restricted.

stringBasedAvailable

Typ: boolean

Beschreibung: Whether the App’s Modul are verfügbar in string-based Projekte. In Datei-based Projekte they are immer verfügbar.

baseUrl muss mit https:// beginnen und kann nach der Installation der App nicht geändert werden, ohne die App zuvor zu deinstallieren. Wähle ihn daher, bevor du die App veröffentlichst.

Gibt den Authentifizierungstyp an, den Crowdin zum Signieren von Anfragen an die App verwendet:

  • crowdin_app: Through an OAuth App. Verwende ihn, wenn die App die Crowdin API jederzeit selbst aufruft.
  • none: Without an OAuth App. Die App kann die API weiterhin erreichen, aber nur, während sie auf der Benutzerseite ausgeführt wird, beispielsweise solange ihr Iframe geöffnet ist. Serverless Apps use this Typ.
  • crowdin_agent: Through a dedicated bot Benutzer that Crowdin erstellens wenn the App is installiereniert, so the App beibehaltens woderking in Projekte nachwards, für Beispiel on a benutzerdefiniert woderkflow step. Die API calls are authenticated as that Benutzer. Erforderlich by the Woderkflow Step Typ Modul.

Weitere Infürmationen zu Sicherheit für Crowdin Apps.

Example:

manifest.json
{
"authentication": {
"type": "crowdin_app",
"clientId": "your-client-id"
}
}
FeldTypBeschreibung
typestringDer Typ des authentication to use: none (the default), crowdin_app, oder crowdin_agent.
clientIdstringOAuth client id für authoderization über the crowdin_app Typ.

Modul are wie an App extends Crowdin. Jede Typ declares wo the App appears in the interface oder was it processes:

  • UI-Module: Panels, Dashboards, Menüs und Dialoge innerhalb von Crowdin.
  • AI Modul: benutzerdefiniert AI bietenrs, prompt bietenrs, und processoders für AI Anfrages.
  • Module zur Dateiverarbeitung: Benutzerdefinierte Dateiformate sowie Verarbeitung vor oder nach Import und Export.
  • Andere Modul: benutzerdefiniert machine translation engines, webhooks, woderkflow steps, QA prüfens, und spellprüfeners.

Weitere Infürmationen zu UI Modul, AI Modul, und File Processing Modul.

A selbst gehostet App registers callbacks für events that happen in the woderkspace. Jede property in this object is a URL relative to the App’s baseUrl, und Crowdin sends a POST Anfrage to it wenn the event fires. Der/Die/Das installed callback ist part of the Installation itself, und the rest behave like webhooks.

Example:

manifest.json
{
"events": {
"installed": "/hook/installed",
"uninstall": "/hook/uninstall"
}
}
EventTypBeschreibung
installedstringSent to the App nach a Benutzer installierens it in Crowdin. Erforderlich mit the crowdin_app und crowdin_agent authentication Typen.
uninstallstringSent to the App bevoder it is uninstalliereniert von Crowdin.

Crowdin sends the installed event to the App wenn a Benutzer installierens it. The payload describes the woderkspace oder proDatei the App was installiereniert to, the App itself, und the Zugangsdaten the App benötigens to fetch an API Token.

Weitere Infürmationen zu installiert Event Flow.

Payload Beispiel:

{
"appId": "your-application-identifier",
"appSecret": "dbfg....asdffgg",
"clientId": "your-client-id",
"userId": 1,
"organizationId": 1,
"domain": null,
"baseUrl": "https://crowdin.com"
}
{
"appId": "your-application-identifier",
"appSecret": "dbfg....asdffgg",
"clientId": "your-client-id",
"userId": 1,
"organizationId": 1,
"domain": "{domain}",
"baseUrl": "https://{domain}.crowdin.com"
}

Eigenschaften:

FeldTypBeschreibung
appIdstringDer/Die/Das Bezeichner of the App that ist declared in the App descriptoder Datei.
appSecretstringThe eindeutig secret verwendet für authoderization of your Crowdin App.
clientIdstringDer/Die/Das OAuth client Bezeichner that ist declared in the App descriptoder Datei.
userIdintegerThe numeric Bezeichner of the Benutzer that installiereniert the App.
organizationIdintegerThe numeric Bezeichner of the Organisation the App was installiereniert to.
domainstringThe Name of the Organisation in Crowdin Enterprise the App was installiereniert to. In Crowdin the value is immer null.
baseUrlstringThe baseUrl of the Organisation in Crowdin Enterprise the App was installiereniert to. In Crowdin the value is immer https://crowdin.com.
agentIdintegerThe numeric Bezeichner of the agent Benutzer erstellt für the App. Sent nur für Apps mit the crowdin_agent authentication Typ.

Crowdin sends the uninstall event to the App bevoder the App is entfernend. Like the installed event, the payload describes the woderkspace oder Konto the App was installiereniert to und the App itself. Use it to entfernen the Daten you Stored für that woderkspace oder Konto.

Payload Beispiel:

{
"appId": "your-application-identifier",
"clientId": "your-client-id",
"organizationId": 1,
"domain": null,
"baseUrl": "https://crowdin.com"
}
{
"appId": "your-application-identifier",
"clientId": "your-client-id",
"organizationId": 1,
"domain": "{domain}",
"baseUrl": "https://{domain}.crowdin.com"
}

Eigenschaften:

FeldTypBeschreibung
appIdstringDer/Die/Das Bezeichner of the App that ist declared in the App descriptoder Datei.
clientIdstringDer/Die/Das OAuth client Bezeichner that ist declared in the App descriptoder Datei.
organizationIdintegerThe numeric Bezeichner of the Organisation the App was uninstalliereniert von.
domainstringThe Name of the Organisation in Crowdin Enterprise the App was uninstalliereniert von. In Crowdin the value is immer null.
baseUrlstringThe baseUrl of the Organisation in Crowdin Enterprise the App was uninstalliereniert von. In Crowdin the value is immer https://crowdin.com.
War diese Seite hilfreich?