Skip to navigation

Sample Apps

Reference apps built on Agent Filesystem
View as Markdown

The Agent Filesystem samples repository on GitHub has reference apps for Agent Filesystem workflows such as managed users, agents with folder-scoped workspaces, automatic token minting, and an agent’s change history and undo. Use them to learn the API and as a starting point for integrating Agent Filesystem into your own apps and services. The samples change along with the Agent Filesystem API.

Agent Filesystem is in Private Preview and is subject to change. Contact your Dropbox representative to request access.

Before you begin

You need an app enabled for the Agent Filesystem Private Preview. Follow Application Setup to create an Agent Filesystem application in the Developer Console. Each sample has a README with its setup steps.

FolderSync

FolderSync is a desktop app that keeps a project folder in sync with a managed user’s Dropbox. You sign in as a managed user, sync a project folder with Sync now, and then undo the changes FolderSync made in Dropbox. Changes made outside FolderSync are kept. It shows how to:

  • Sign in as your app and mint tokens on a backend. A small token server stands in for your backend: it holds the app key and secret, keeps the secret out of the app, and mints the managed user’s token. FolderSync uses that token to mint each agent’s token, and mints new ones automatically before they expire.

    App key: <your_app_key>
    App secret (hidden):
    Starting the token server…
    … checking the app key and secret with Dropbox...
    … token server listening on http://127.0.0.1:8787
  • Sign users in as managed users. A user types a name, and the token server creates a managed user for a new name or signs back in to the existing one. Any name works here, for the demo. In your product, your backend checks who your user is before it mints their managed user’s token.

    The FolderSync sign-in screen with the name managed-user-1
  • Give each project an agent whose workspace is limited to that project’s folder. FolderSync writes changes with the agent’s token, so Dropbox records them as the agent’s. FolderSync syncs when you click Sync now, not in the background. Undo is next to it.

    A synced project in FolderSync: up to date after two uploads, with Undo and Sync now
  • See the agent’s change history and undo back to a chosen change. Dropbox undoes that change and every change after it, and keeps changes made outside FolderSync.

To run it, follow Run FolderSync in its README.