Provision SharePoint Site using Custom Template with PnP JS

Ahamed Fazil Buhari
Senior Developer
September 27, 2018
Rate this article
[Total: 0    Average: 0/5]


In this article we will see how to provision SharePoint site using PnP JS and more we can provision by our own custom site template. For this we need to know the GUID of your custom template, there are various way to get GUID of site template and one of the easy way is shown below,

I just moved to the page where we can manually create subsite (https://<sharepointURL>/_layouts/15/newsbweb.aspx ). Right click on the custom template name and select Inspect from your browser so that you can see the source of the page and from that we can get GUID of your custom template.



Once we get the template ID, we need to call below PnP code to provison site and in the parameter we need to provide values for following options –

Site Title, URL, description, template name or ID, lang, permission Inheritance.

 import pnp from "sp-pnp-js/lib/pnp";
           "New Sub Site",
           "Description for the new Site",
         .then(function(result) {
           if ( {
             alert("Site created successfully");
         .catch(e => {
           console.log("eeerrr", e);




Happy Coding


Author Info

Ahamed Fazil Buhari
Senior Developer
Rate this article
[Total: 0    Average: 0/5]
Ahamed is a Senior Developer and he has very good experience in the field of Microsoft Technologies, especially SharePoint 2013, 2016 and O365, Azure, ASP.NET, SQL Server, IIS and client more

Leave a comment