Sharing Saved Materials

The Share feature in the Pieces Web Extension lets you create a shareable link for your snippets from the Pieces Drive to share them directly from the browser interface.


What Information Gets Shared

When a snippet is saved to the Pieces Cloud, the code is enriched with valuable information such as related people, links, annotations, tags, and an automatically-generated description.

There are two ways to share saved snippets: by using the Pieces Quick Actions on code blocks on websites or directly from Pieces Drive within the Pieces Web Extension.

This link can easily be shared via email, Discord, Slack, or other platforms. The recipient can view the snippet without the recipient needing to have a Pieces account.

via Codeblock Quick Actions

Shareable Pieces links for code snippets found on the web can be generated by clicking Share under a code block on the web.

Sharing a Previously Saved Snippet

If you save a material, but didn’t generate a shareable link at the time, no problem.

You can still generate a shareable link (or copy, regenerate, and delete the existing link) from the Pieces Drive.

1

Open the Pieces Web Extension

Click the Pieces icon within the extensions section of your browser.

2

Open the Pieces Drive Section

After the Pieces Web Extension is opened, select the dropdown in the top left and choose Pieces Drive. You can then switch to the Saved Materials section to see all of your previously saved snippets.

3

Locate the Snippet

Locate a snippet you’d like to share and select it to open the Quick Preview.

4

Generate the Link

Click the Generate Shareable Link option at the bottom of the snippet Quick Preview.

Alternatively, access sharing options using the Quick Menu (three-dot icon) button.

5

Copy the Link

A new pop-up will appear giving you options to copy the personal link or generate a GitHub Gist.

Enriched Sharing Experience

When you Share a snippet, it’s not just the code that’s included. The snippet comes with additional metadata to provide context—you can read more about that here.

  • Snippet Type: Identify the language or framework, such as Python or React.

  • Tags: Useful keywords for quick categorization.

  • Description: A short summary of what the snippet does.

  • Related Links: Helpful resources or documentation tied to the snippet.

  • Author Information: A record of who created the snippet.

Sensitive Information Watchdog

The Share feature does more than just allow you to effectively share snippets across your entire team and other communities, though.

You'll see a section titled Sensitive Information:

Our in-house ML model scans snippets for potentially sensitive information, like API keys or passwords, and alerts you so that you can make an informed decision before sharing the snippet.  

The scan happens locally using on-device machine learning models before the snippet is uploaded to the drive for sharing. This allows you to make an informed decision about sharing your code on a case-by-case basis.

Updated on