Example Secret Input avatar
Example Secret Input
Try for free

No credit card required

View all Actors
Example Secret Input

Example Secret Input

apify/example-secret-input
Try for free

No credit card required

This Apify actor showcases how to use secret fields in the actor input.

Example secret input actor

This Apify actor showcases how to use secret fields in the actor input.

Setting an input field as secret

To make an input field secret, just set "isSecret": true to the field in the actor's INPUT_SCHEMA.json, like this:

1{
2    // ...
3    "properties": {
4        // ...
5        "password": {
6            "title": "Password",
7            "type": "string",
8            "description": "A secret, encrypted input field",
9            "editor": "textfield",
10            "isSecret": true
11        },
12        // ...
13    },
14    // ...
15}

The editor for this input field will then turn into a secret input, and when you edit the field value, it will be stored encrypted. Secret input editor

Reading secret input fields

When you read the actor input through Actor.getInput(), the encrypted fields are automatically decrypted, without any additional code needed.

1> await Actor.getInput();
2{
3    username: 'username',
4    password: 'password'
5}

If you read the INPUT key from the actor run's default key-value store directly, you will still get the original, encrypted input value.

1> await Actor.getValue('INPUT');
2{
3    username: 'username',
4    password: 'ENCRYPTED_VALUE:Hw/uqRMRNHmxXYYDJCyaQX6xcwUnVYQnH4fWIlKZL2Vhtq1rZmtoGXQSnhIXmF58+DjKlMZpTlK2zN3YUXk1ylzU6LfXyysOG/PISAfwm27FUgy3IfdgMyQggQ4MydLzdlzefX0mPRyixBviRcFhRTC+K7nK9lkATt3wJpj91YAZm104ZYkcd5KmsU2JX39vxN0A0lX53NjIenzs3wYPaPYLdjKIe+nqG9fHlL7kALyi7Htpy91ZgnQJ1s9saJRkKfWXvmLYIo5db69zU9dGCeJzUc0ca154O+KYYP7QTebJxqZNQsC8EH6sVMQU3W0qYKjuN8fUm1fRzyw/kKFacQ==:VfQd2ZbUt3S0RZ2ciywEWYVBbTTZOTiy'
5}

Further information

You can find out more about the secret input feature in the secret input docs.

Developer
Maintained by Apify
Actor metrics
  • 1 monthly users
  • 100.0% runs succeeded
  • Created in Oct 2022
  • Modified 5 months ago