Skip to main content

Personal Asset Management within Showpad Apps

Showpad

Empower users to securely upload, preview, and manage their personal assets—such as PDFs, images, and Office files—directly within a Showpad App, without relying on the Files Library or external systems.

Classic Situation

You're developing a custom Showpad App and require the ability for users to manage their own private content within the app.

This includes:

  1. Uploading files
  2. Previewing them
  3. Accessing them later

Since these files should be stored per user and not publicly available in the Files Library, and you want to keep the user within the custom Experience, traditional approaches like using the AppsDB or relying on admin-only features are insufficient.

Solution Example

With Showpad Apps v2, you can leverage our enhanced SDK to create a user-centric asset management workflow. This allows each user to upload files privately and access them later for previewing or downloading—all within the app environment.

Prerequisites
  • Plan: Ultimate | Advanced or Expert
  • Permissions: Administrator access to Showpad's Admin App
  • Config:
    • Build a Showpad App v2 that makes use of the SDK
    • Ensure users have access to My Files.

Steps

  1. Upload the asset to My Files

    Use the SDK’s upload method to upload the file and capture the returned asset's id and slug.

    const file = await Showpad.upload();
    const assetId = file.assetId;
    const assetSlug = file.slug;
  2. Retrieve the user ID

    Use getUserInfo() to get the user’s unique identifier.

    const userInfo = await Showpad.getUserInfo();
    const userId = userInfo.id;
  3. Store the asset data per user

    Use setStoreEntryValue() to save the asset ID and slug into AppsDB under a key tied to the user.

    const storeKey = `userAssets_${userId}`;
    const value = JSON.stringify({ assetId, assetSlug });
    await Showpad.setStoreEntryValue(storeKey, value);
  4. Retrieve the user’s asset

    Use getStoreEntryValue() to access the stored data later.

    const storedValue = await Showpad.getStoreEntryValue(storeKey);
    const { assetId, assetSlug } = JSON.parse(storedValue);
  5. Display the asset

    Use getAssetPreviewUrl() and getAssetFileUrl() to generate URLs for previewing and downloading the file.

    const previewUrl = await Showpad.getAssetPreviewUrl(asetId, assetSlug);
    const fileUrl = await Showpad.getAssetFileUrl(assetId, assetSlug);

Conclusion

By leveraging the capabilities of Showpad Apps v2, you can provide users with a seamless and secure way to manage their private assets within the app. This approach eliminates the need for administrator intervention or external services, offering a practical and scalable solution for personal file management in Showpad.

And that's it! Once you've got everything set up and running smoothly, you'll enjoy seamless personal asset management directly within your Showpad App.

info

If you need assistance, please reach out to Showpad.