The app descriptor is one of the essential building blocks of Crowdin apps. The app descriptor is a JSON file (for example, crowdin.json
) that includes general information for the app, as well as the modules that the app wants to operate with or extend. It describes how the application will work, what resources will be used, etc. You can see an example below.
{
"identifier": "your-application-identifier",
"name": "Your Application",
"description": "Application description",
"logo": "/assets/logos/app-logo.png",
"baseUrl": "http://example.com",
"authentication": {
"type": "authorization_code",
"clientId": "your-client-id"
},
"events": {
"installed": "/hooks/installed"
},
"scopes": [
"project"
],
"modules": {
"integrations": [
{
"key": "your-module-key",
"name": "Module Name",
"description": "Module description",
"logo": "/assets/logos/module-logo.png",
"url": "/page/integration",
"environments": [
"crowdin-enterprise"
]
}
]
}
}
identifier | Type: Note: Don't use uppercase in the app identifier. Required: yes Description: A unique key to identify the app. This identifier must be <= 255 characters. |
name | Type: Required: yes Description: The human-readable name of the app. |
baseUrl | Type: Required: yes Description: The base URL of the remote app, which is used for all communications back to the app instance. This is important: choose your baseUrl wisely before making your app public. Note: Each app must have a unique baseUrl. If you would like to serve multiple apps from the same host, |
authentication | Type: Required: yes Description: Specifies the authentication type to use when signing requests between the host application and the Crowdin app. |
description | Type: Descrizione: La descrizione leggibile dall'uomo di cosa fa l'app. |
logo | Type: Descrizione: L'URL dell'immagine relativa all'URL di base dell'app che sarà mostrato nell'UI di Crowdin Imprese. |
events | Type: Description: Allow the app to register for app event notifications. |
scopes | Type: [ Descrizione: Serie di ambiti richiesti da quest'app.
|
modules | Type: Description: The list of modules this app provides. |
environments | Type: [ Allowed values: Descrizione: Serie di ambienti in cui è installabile un modulo.
|
Specifies the authentication type to use when signing requests from the host application to the Crowdin app. Crowdin Apps support two types of authentication:
authorization_code
value)none
value)In case your Crowdin app requires access to Crowdin API at any time, it’s recommended to use the authorization_code
, in other cases feel free to use the none
. The authentication type none
grants access to Crowdin API as well as the authorization_code
, but only when the Crowdin app is executed on the user side, for example, when the iframe opens.
Esempio:
{
"authentication": {
"type": "authorization_code",
"clientId": "your-client-id"
}
}
Properties:
type | Type: Defaults to: Allowed values: Description: The type of authentication to use. |
clientId | Type: Description: OAuth client id for authorization via the |
I moduli sono come le app estendono Crowdin Imprese e vi interagiscono. Using modules your app can do the following things:
Leggi di più sui Moduli.
Allow an app to register callbacks for events that occur in the workspace. When an event is fired, a POST request will be made to the appropriate URL registered for the event. The installed callback is an integral part of the installation process of an app, whereas the remaining events are essentially webhooks. Each property within this object is a URL relative to the app’s base URL.
Esempio:
{
"events": {
"installed": "/hook/installed",
"uninstall": "/hook/uninstall"
}
}
Properties:
installed | Type: Descrizione: L'evento inviato a un'app dopo che un utente ha installato l'app in Crowdin Impresa. This event is required if you use |
uninstall | Type: Descrizione: L'evento inviato a un'app prima della sua disinstallazione da Crowdin Impresa. |
Installed event
L’evento installato è inviato da Crowdin Impresa all’app remota di Crowdin quando un utente installa l’app in Crowdin Impresa. L’evento Installato contiene le informazioni sull’area di lavoro di Crowdin Impresa in cui è stata installata l’App di Crowdin, le informazioni sull’app stessa, nonché l’authorization_code dell’app. As soon as the authorization_code is received it’s necessary to authorize the app using the access and refresh tokens.
Leggi di più sul Flusso dell’Evento Installato.
Payload example:
{
"appId": "your-application-identifier",
"clientId": "your-client-id",
"userId": 1,
"organizationId": 1,
"domain": "{domain}",
"baseUrl": "https://{domain}.crowdin.com",
"code": "def.....608bdad9c625bd2eedf1fd6"
}
Properties:
appId | Type: Description: The identifier of the app that is declared in the app descriptor file. |
clientId | Type: Description: The OAuth client identifier that is declared in the app descriptor file. |
userId | Type: Descrizione: L'identificativo numerico dell'utente che ha installato l'app in Crowdin Impresa. |
organizationId | Type: Description: The numeric identifier of the organization the app was installed to. |
domain | Type: Description: The name of the organization the app was installed to. |
baseUrl | Type: Description: The baseUrl of the organization the app was installed to. |
code | Type: Description: The code used for authorization of your Crowdin app. |
Uninstall event
L’evento di disinstallazione è inviato da Crowdin Impresa all’app remota di Crowdin quando un utente la disinstalla da Crowdin Impresa. L’evento di Disinstallazione, come l’evento d’installazione, contiene le informazioni sull’area di lavoro di Crowdin Impresa in cui è stata installata l’App di Crowdin, e le informazioni sull’app stessa. Dopo averlo ricevuto, è necessario trovare e rimuovere tutti i dati correlati all’area di lavoro di Crowdin Impresa da cui è stata rimossa l’app.
Payload example:
{
"appId": "your-application-identifier",
"clientId": "your-client-id",
"organizationId": 1,
"domain": "{domain}",
"baseUrl": "https://{domain}.crowdin.com"
}
Properties:
appId | Type: Description: The identifier of the app that is declared in the app descriptor file. |
clientId | Type: Description: The OAuth client identifier that is declared in the app descriptor file. |
organizationId | Type: Description: The numeric identifier of the organization the app uninstalled from. |
domain | Type: Description: The name of the organization the app uninstalled from. |
baseUrl | Type: Description: The baseUrl of the organization the app uninstalled from. |