Skip to main content

Private file upload at signup (AI-assisted coding)

Collect a file from users when they sign up, such as a license, certificate, or proof of insurance, and let them view and replace it later in account settings.

Written by Sharetribe Team

Sharetribe's APIs support private user files. Private files can be stored on a user's account, and only the user and you (the marketplace operator) can access them. You can view and download them in Console. Using private files requires custom code, but you don't need to be a developer to add them. With AI-assisted coding, an AI tool like Claude writes the code from a plain-language description.

This article gives you a ready-made prompt to add a private file upload to your signup form and Account settings. You customize a few details, paste it into your AI tool, and work from there. The AI will still ask you clarifying questions, and getting the result you want often takes a few rounds of feedback.

If you're new to AI-assisted coding (or vibecoding), start with these:

Before you start

This article assumes you've already completed the setup in the tutorial: How to start AI-assisted coding on top of Sharetribe. You should have, at minimum:

  • A development environment in Console

  • A local copy of the Sharetribe Web Template running on your computer

  • The Claude desktop app (or another AI coding tool) with the Sharetribe Development Plugin installed

The steps below use the Claude desktop app, but the same prompt should work in other AI coding tools as well.

Step 1: Decide the details

Before you prompt, decide how the feature should work in your marketplace. Answering these up front saves you a round or two of questions later.

  1. What is the file? For example "Resume", "License", "Certificate", or "Proof of insurance".

  2. Which user type uploads it? If your marketplace has more than one user type, pick the one that should upload the file, for example "provider" or "seller". If you only have one user type, everyone uploads it.

  3. Is the upload required or optional at signup? If it's required, users can't submit the signup form without it.

  4. What should the Account settings tab be called? For example "Documents" or "Verification".

  5. Where should the tab appear in the Account settings sidebar? For example below Contact details, above Manage account, or as the last tab.

Not sure yet? You can leave a detail out and the AI will ask you about it.

Step 2: Copy and customize the prompt

Copy the prompt below and replace the parts in [square brackets] with the answers to the questions above.

You can leave the rest as it is or modify it already to better match your needs. The UI and technical sections tell the AI how the feature should look and where to store the file, so you don't have to work that out yourself.

Add a private file upload feature for one user type.

Users with the [user type, e.g. provider] user type must upload a [file name, e.g. Resume] when signing up. The upload is [required/optional] before they can submit the signup form.

After signup, the user can view, download, and replace the file in Account settings, in a new tab called [tab name, e.g. Resume, License]. Place the tab [position, e.g. below Contact details]. The tab is only visible to the [user type] user type.

The file is private. Use Sharetribe's Files API for storage. Context for files in Sharetribe: https://www.sharetribe.com/docs/concepts/files/files-in-sharetribe/

UI behavior:
- Signup form: a primary button to upload the file that opens a file picker. Once a file is chosen, show the filename and a "Change file" link instead of the button.
- Account settings tab: show the current filename with a Download link. Below it, an upload section with a button to “Update file”. Otherwise, use the same file name behavior as above, and a "Save changes" button.
- Buttons match the app's primary button style (primary color, no border, full width).
- On narrow screens, make sure long file names don’t break the layout or cause horizontal scroll.

Technical approach:
- Use Sharetribe's Files API for private file storage.
- Store the file ID and filename in the user's privateData.
- Add server-side API routes for upload, attach, and download URL.
- Make the file tab a standalone page in Account settings, not part of Contact details.

Before writing any SDK calls, read node_modules/sharetribe-flex-sdk/docs/ and check src/endpoints.js to verify the method exists and its expected parameters.

Ask clarifying questions to improve the prompt if needed.

Or, you can start smaller. Writing a shorter, vaguer prompt will in turn make your AI ask further questions. There might be more back and forth, but you’ll be able to see the process of things, which may be useful if you don’t have such a clear idea of how the feature should work.

Here’s an example of a shorter prompt.

I want to collect a file when a [provider/customer] signs up. It’s a user type specific file: other user types don’t upload anything.

The document should be a private file attachment. Files documentation: https://www.sharetribe.com/docs/concepts/files/files-in-sharetribe/

The file should be collected in the signup form.

After signing up, the provider can access the file in their account settings. Add a new tab in account settings for this file.

Before writing any SDK calls, read node_modules/sharetribe-flex-sdk/docs/ and check src/endpoints.js to verify the method exists and its expected parameters.

Step 3: Work through it with the AI

When you send the prompt in Claude Code, you can expect a conversation rather than a finished feature on the first try. Here are a couple of useful pointers:

  • Even with a detailed prompt, the AI may ask things like which file types to accept or what to show if an upload fails. Answer in plain language. If you don't know, ask it to suggest a sensible default and explain why.

  • With Ask permissions mode on, Claude shows each change before making it. You don't need to understand every line of code, but check that the changes match what you asked for.

  • Once the AI has built the first version, open your local development marketplace and look at the result.

Step 4: Test the feature

AI output is never exactly the same twice, so even though we’ve prompt and successfully added features with, it doesn’t mean that the results work as expected. Things might not when you start testing. When you run into problems, tell the AI what’s not working, share any errors you get, and it will reiterate. If you want to start over, you can also ask it to undo its changes.

As you test, tell the AI what to change, one thing at a time. For example:

  • "The upload button is grey. Make it use the primary button style like the signup button."

  • "Move the Files tab so it's directly below Contact details."

  • "Customers can see the Documents tab. Hide it for everyone except providers."

Here’s a suggested testing to-do list:

  • Sign up as the user type that uploads the file. Check the upload button, the filename, and the "Change file" link.

  • If the upload is required, try submitting the signup form without a file. The signup button shouldn’t be enabled.

  • Sign up as a different user type. Check that the file upload doesn't appear and the Account settings tab is hidden.

  • Open the new tab in Account settings. Download the file, replace it, and save. Check that the new filename shows.

  • Find the user in user management in Console and check that you can view and download the file.

  • Log in as another user and check that you can't access the first user's file.

  • Repeat the signup and Account settings checks on a mobile screen.

If you plan to go live with this feature, consider having a Sharetribe Expert review the code. Features that handle private user data are a good case for a professional review.

What to build next

You can use private files and protected transaction files for other workflows too:

  • Add reusable files that providers can share in any transaction, like a price list

  • Let users replace transaction files, for example to swap a file delivered by mistake

For the technical details behind these features, learn more about files in our developer documentation.

Did this answer your question?