By Emmanuel Aina

<aside> 💡 “A share target is the abstract concept of a destination that the user agent will transmit the share data to. What constitutes a share target is at the discretion of the user agent.” - WCIG

</aside>

share-target-example.png

Here, I would look into sharing using the native share feature on the web. Making your PWA available requires two simple steps:

First step

Updating your manifest.json with the code below:

. . . ,
"share_target": {
	"action": "share-target",
	"method": "GET",
	"enctype": "application/x-www-form-urlencoded",
	"params": {
		"title": "title",
		"text": "text",
		"url": "url"
	}
}

A detailed explanation of the code above:

Once an app is selected as a share destination, the data is sent to the page previously specified in the share_target.action - in the form of a REST API call.