In the examples below, replace YOUR_ID
by the ID from your personal link.
For a detailed example, see Adding a private feedback box to Bear.
let encryptAndSend = null;
async function send(task) {
try {
if (!encryptAndSend) {
const frogtab = await import("https://frogtab.com/open/sdk.js");
encryptAndSend = await frogtab.connectToInbox("YOUR_ID");
}
return await encryptAndSend(task);
}
catch (err) {
return false;
}
}
send("Record a demo of the latest product features").then(success => {
console.log(success);
});
async function getKeyID(userID) {
const frogtab = await import("https://frogtab.com/open/sdk.js");
userDetails = await frogtab.getUserDetails(userID);
return userDetails.pgpPublicKeyID;
}
getKeyID("YOUR_ID").then(keyID => {
console.log(keyID);
});
For a detailed explanation, see Making a command-line tool for your Frogtab personal link.
- Download your public key:
curl https://frogtab.com/key_YOUR_ID.asc > frogtab.asc
- Import your public key into GnuPG and change the trust level of the key:
gpg --import frogtab.asc
gpg --edit-key "KEY_ID"
gpg> trust
gpg> 5
gpg> quit
- Use a shell script to send the task:
#!/bin/sh
ID="YOUR_ID"
KEY="KEY_ID"
TASK="Record a demo of the latest product features"
ENCRYPTED_TASK="$(echo "$TASK" | gpg --armor --encrypt --recipient "$KEY")"
if [ $? -ne 0 ]; then
echo "Error: gpg error" >&2
exit 1
fi
POST_URL=https://frogtab.com/open/post-add-message
POST_TYPE="Content-Type: application/json"
POST_BODY="$(jq -n --arg p1 "$ID" --arg p2 "$ENCRYPTED_TASK" '{user_id: $p1, message: $p2}')"
curl -s -X POST -H "$POST_TYPE" -d "$POST_BODY" "$POST_URL" | jq -e '.success == true' > /dev/null
if [ $? -ne 0 ]; then
echo "Error: Unable to send task" >&2
exit 1
fi