O'Reilly logo

Meteor Cookbook by Isaac Strack

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Protecting the client with browser-policy

Securing your database is pretty straightforward in Meteor, but what about client-side security? Meteor has you covered there as well, using standard Content-Security-Policy and X-Frame-Options safeguards. This recipe will walk you through adding the browser-policy package, and configuring basic client-side security.

Getting ready

We will create a brand new project as usual, but we will be keeping the default files, creating some unsafe scripting functionality along the way.

Scaffolding setup

In a terminal window, navigate to where your project root will be, and execute the following commands:

$ meteor create secure-client
$ cd secure-client
$ mkdir {client,server,both}
$ mv secure-client.* client/
$ meteor ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required