Socket
Book a DemoInstallSign in
Socket

@etchteam/recycling-locator

Package Overview
Dependencies
Maintainers
4
Versions
121
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@etchteam/recycling-locator

Find places to recycle, refill or reuse items.

latest
Source
npmnpm
Version
1.65.0
Version published
Maintainers
4
Created
Source

Recycling Locator

Powered by RecycleNow.com, this tool can be used to search and find recycling locations throughout the United Kingdom. It’s been created as an embeddable widget that can be added to any website to help visitors discover more recycling options.

Add the widget to your website

To apply to embed the widget on your website, email us at PartnerEnquiries@wrap.org.uk.

Installation won't work until your application has been approved.

Option 1: Install the script

Add the script above the closing </body> tag.

<script src="https://rl.recyclenow.com/wrap-rlw.js" async defer></script>

Include an element with the id "wrap-rlw" into your HTML, this is where the widget will be output.

<div id="wrap-rlw"></div>

Include the global stylesheet (optional)

<link href="https://rl.recyclenow.com/recycling-locator.css">

Option 2: Install the web component

Install via NPM

npm i -S @etchteam/recycling-locator`

Include the web component in your HTML, this is where the widget will be output.

<recycling-locator></recycling-locator>

Include the stylesheet within your website styles (optional)

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@etchteam/recycling-locator@latest/dist/recycling-locator.css">

⚠️ Dependabot is configured to notify daily for NPM version changes, falling out of date means the widget could stop working due to upstream breaking API changes.

Available settings

Locale

Use the locale attribute to set the language.

The language code for Welsh (cy) is currently the only supported language code.

Script

<script src="..." data-locale="cy"></script>

Web component

<recycling-locator locale="cy"></recycling-locator>

Theme

Accepted values are red, blue, green, orange, purple, brown, navy, or black.

Script

<script src="..." data-theme="red"></script>

Web component

<recycling-locator theme="red"></recycling-locator>

CSS variables

For more granular control over the theme, add CSS variables to your stylesheet.

:root{
  /* The primary colour is the main color that's changed via theme presets */
  --recycling-locator-color-primary-lightest: #eef5e5;
  --recycling-locator-color-primary-light: #dfefc8;
  --recycling-locator-color-primary: #8dc63f;
  --recycling-locator-color-primary-dark: #297f00;

  /* Other variables control specific parts of the UI */
  --recycling-locator-theme-background: #fff;
  --recycling-locator-theme-background-muted-light: #f5f6f8;
  --recycling-locator-theme-heading-color-light: #222;
  --recycling-locator-theme-color-light: #222;
  --recycling-locator-theme-color-muted-light: #4f4f4f;
  --recycling-locator-theme-color-hover: var(--recycling-locator-color-primary-dark);
  --recycling-locator-theme-border-color-light: #cfd1d3;
  --recycling-locator-theme-border-color-hover-light: var(--recycling-locator-color-primary-dark);
  --recycling-locator-theme-link-color: var(--recycling-locator-color-primary-dark);
}

Path

The initial path to load. Common examples include:

  • /{postcode} to pre-fill the location
  • /home-recycling for home recycling embeds
  • /material?materials=111&search=Cereal boxes to pre-select a material
  • /{postcode}/places/{placeName}/{placePostcode} to load a single place

To discover other possible initial path combinations, take note of the path in the URL whilst navigating on the standalone version of the tool at locator.recyclenow.com.

Script

<script src="..." data-initial-path="/home-recycling"></script>

Web component

<recycling-locator path="/home-recycling"></recycling-locator>

Materials

This setting is only available for the script installation method for backwards compatibility.

The same can be achieved by passing materials in the path web component attribute.

Example with material id:

<script src="..." data-materials="1"></script>

Example with multiple materials:

<script src="..." data-materials="[1,2]"></script>
View the list of available material IDs
IDNameName (cy)
1Cardboard egg boxesBocs cardfwrdd ar gyfer wyau
2Cardboard fruit and veg punnetsBasgedi cardfwrdd ar gyfer ffrwythau a llysiau
3Cardboard sleevesCloriau cardfwrdd
4Cereal boxesBocsys grawnfwyd
5Corrugated cardboardCardfwrdd gwrymiog
6Food and drink cartonsCartonau bwyd a diodydd
7Toilet roll tubesRholiau papur tŷ bach
8Greeting cardsCardiau cyfarch
9Brown envelopesAmlenni brown
10Junk mailLlythyrau sgrwtsh
11MagazinesCylchgronau
12NewspapersPapurau newydd
13Shredded paperPapur wedi’i falu
14Telephone directoriesCyfeirlyfr ffôn
15Window envelopesAmlenni ffenestr
16Yellow PagesTudalennau melyn
17BooksLlyfrau
18Aluminium foilPapur alwminiwm
19Foil traysHambyrddau papur arian
20Glass bottles and jarsPoteli a jariau gwydr
21Ovenware (pyrex)Llestri popty (pyrex)
22Window glassGwydr ffenestri
23AerosolsErosolau
24Drinks cansCaniau diodydd
25Food tinsTuniau bwyd
26Metal lids from glass jarsCaeadau metel jariau gwydr
27Scrap metalMetel sgrap
28BatteriesBatrïau
29BicyclesBeiciau
30CorkCorcyn
31SpectaclesSbectol
32StampsStampiau
33Upholstered furnitureDodrefn wedi eu clustogi
34Non-upholstered furnitureDodrefn heb eu clustogi
35Bric-a-bracMân drugareddau
36Non-electric toys & gamesTegannau a gemau anelectronig
37Toner & printer cartridgesCetris peiriant argraffu
38CeramicsLlestri
39Water filtersHidlydd dŵr
40Prams & pushchairsPramiau a choetsys cadair
41Records, CDs & DVDsRecordiau, CD a DVD
42Household cleaner & detergent bottlesPoteli hylifau glanhau
43Plastic milk bottlesPoteli llaeth
44Plastic drinks bottlesPoteli diodydd
45Toiletries & shampoo bottlesPoteli sebon a siampŵ
46Plastic carrier bagsBagiau siopa
47Food pots & tubsPotiau a thybiau bwyd
48Margarine tubsTybiau margarin
49Plant potsPotiau planhigion
50Plastic traysHambyrddau plastig
51Yoghurt potsPotiau iogwrt
52ClothingDillad
53Household linensLlieiniau’r cartref
54Shoes & bagsEsgidiau a bagiau
55Fridge & freezersOergelloedd a rhewgelloedd
56Electric cookers & ovensPoptai trydan
57Washing machines & dryersPeiriannau golchi a sychu
58LaptopsCliniaduron
59ComputersCyfrifiaduron
60TVsSetiau teledu
61DVD/CD playersChwaraewyr DVD/CD
62Hi-fiHi-fi
63Telephones/faxTeleffonau/ffacs
64Mobile phonesFfonau poced
65CamerasCamerâu
66Toasters, kettles, & vacuumsPeiriant tostio, tegell, sugnwr llwch
67Hairdryers & electric toothbrushesSychwr gwallt, brws dannedd trydan
68Electrical home & garden toolsOffer trydan i’r cartref a’r ardd
69Electronic toys & gamesTegannau a gemau electronig
70Energy-saving light bulbsBylbiau arbed ynni
71MicrowaveMicrodon
72Table lampsLlampiau bwrdd
73Kitchen oilsOlew coginio
74Cleaning fluidsHylif glanhau
75Paint, varnishPaent, farnais
76Paint (for reuse)Paent (i’w ailddefnyddio)
77Gas bottlesPoteli nwy
78TyresTeiars
79Car batteriesBatrïau ceir
80Engine oilOlew peiriant
81Bricks, rubble & concreteBriciau, rwbel, concrit
82SoilPridd
83AsbestosAsbestos
84Doors, beams, fireplacesDrysau, trawstiau, llefydd tân
85Scrap woodCoed sgrap
86FlowersBlodau
87Grass cuttingsTorion gwair
88LeavesDail
89PlantsPlanhigion
90Prunings & twigsBrigiau a thorion llwyni
91WeedsChwyn
92Christmas treesCoed Nadolig
93BreadBara
94Cakes & pastriesTeisennau, cacennau
95Dairy products - eggs, cheese & milkCynnyrch llaeth – wyau, caws, llaeth
96Raw & cooked meat including bonesCig amrwd neu wedi’i goginio, gan gynnwys esgyrn
97Raw & cooked fish including bonesPysgod amrwd neu wedi’u coginio, gan gynnwys esgyrn
98Raw & cooked vegetables including peelingsLlysiau amrwd neu wedi’u coginio, gan gynnwys plicion
99RiceReis
100PastaPasta
101Beans & pulsesFfa a chodlysiau
102Uneaten food & plate scrapingsBwyd heb ei fwyta a chrafion platiau
103Tea leaves, tea bags & coffee grindsDail te, cydau te a gwaddod coffi
104Uneaten food without packagingBwyd heb ei fwyta heb becynnu
105Paper cupsCwpanau papur
106Set top boxesBlychau-pen-set
107RoutersLlwybryddion
108Coffee cupscwpanau coffi
109Bread bagsBagiau bara plastig
110Glue sticksGlue sticks
111Expanded polystyrenePolystyren ehangedig
112Frozen food bagsBagiau bwydydd o’r rhewgell
113Cereal linersBagiau leinio grawnfwyd
114Delivery bagsBagiau danfon nwyddau drwy’r post
115Multi-pack wrappingDeunydd lapio pecynnau aml-becyn
116Salad, pasta, and rice bagsBagiau salad, pasta a reis
117Cheese, fish and meat wrappingDeunydd lapio caws, pysgod a chig
118Crisp packets and sweet bagsPecynnau creision a bagiau losin
119Biscuit and chocolate wrappersDeunydd lapio bisgedi a siocled
120Baby, pet food, detergent and cleaning pouchesPecynnau meddal bwydydd babanod, anifeiliaid anwes, glanhawyr a nwyddau glanhau
121Plastic film lidsCaeadau haenen blastig
122Toilet roll wrappingBagiau papur toiled
123Plastic lipstick or lip balm tubesTiwbiau minlliw neu balm gwefusau
124Plastic eyeliner or concealer penPen llinellu llygaid neu golur cuddio
125Plastic concealer or eye shadow tubes (inc applicator)Tiwbiau colur cuddio neu golur llygaid (yn cynnwys y ffon)
126Plastic mascara tubes (inc brush, wand)Tiwbiau masgara plastig (yn cynnwys y brwsh/ffon)
127Eyeshadow & brow palettes & compactsCasys powdr colur llygaid ac aeliau
128Plastic make-up tubesTiwbiau plastig sy’n dal colur
129Plastic lip balm potsPotiau plastig sy’n dal balm gwefusau
130Plastic body, hair and face cream pot and tubesTybiau a phostiau plastig sy’n dal hylif corff, cynnyrch gwallt neu eli wyneb
131Plastic body lotion, hand cream and sunscreen tubesTiwbiau plastig sy’n dal hylif corff, eli dwylo neu eli haul
132Plastic refill pouchesPecynnau plastig meddal ar gyfer ail-lenwi poteli ac ati
133Plastic sachets, samples and hotel bottle minisPecynnau plastig bychain ar gyfer samplau, poteli mini a geir mewn gwestai
134Plastic dropper bottlesPoteli diferydd plastig
135Plastic roll-on and stick deodorantsPecynnau diaroglydd rholiwr neu flocyn diaroglydd plastig
136Plastic combsCribau plastig
137Plastic contact lens casesCasys lensys cyffwrdd plastig
138Plastic toothpaste tubesTiwbiau past dannedd plastig
139Face and hair mask packaging (single use)Deunyddiau pacio masg wyneb a gwallt (rhai untro)
140Wipes packetsPecynnau weips
141Toothbrushes or electronic toothbrush headsBrwshys dannedd neu bennau brwshys dannedd electronig
142Walking aidsCymhorthion cerdded
143Absorbent hygiene products (AHP)Cynnyrch hylendid amsugnol (AHP)
144Vapes/e-cigarettesvapes/e-sigarennau
145Coffee podsPodiau coffi
146AsbestosAsbestos

Public path

This setting is only available for the web component installation method.

This setting can be used to set a public URL to load assets from, the path should always end with a /.

If not provided, jsdelivr CDN will be used.

The following example would serve assets from your websites public directory:

<recycling-locator public-path="/public/"></recycling-locator>

To self-host assets, static files can be moved from node_modules using a postinstall script.

cp -r ./node_modules/@etchteam/recycling-locator/dist/images ./public
cp -r ./node_modules/@etchteam/recycling-locator/dist/translations ./public
cp ./node_modules/@etchteam/recycling-locator/dist/recycling-locator.css ./public
cp ./node_modules/@etchteam/recycling-locator/dist/styles.css ./public

Content Security Policy (CSP)

If your website implements a CSP, it'll need some changes based on whether the script or web component installation option is being used.

Script

  • img-src data: https://rl.recyclenow.com https://*.here.com;
  • script-src https://rl.recyclenow.com 'unsafe-eval';
  • connect-src blob: https://rl.recyclenow.com https://*.sentry.io https://*.hereapi.com https://*.here.com;
  • style-src 'unsafe-inline' https://rl.recyclenow.com;
  • font-src https://*.here.com;
  • worker-src blob:;

Web component

  • img-src data: https://cdn.jsdelivr.net https://*.here.com;
  • script-src 'self' 'unsafe-eval';
  • connect-src blob: https://cdn.jsdelivr.net https://rl.recyclenow.com https://*.sentry.io https://*.hereapi.com https://*.here.com;
  • style-src 'unsafe-inline' https://cdn.jsdelivr.net;
  • font-src https://*.here.com;
  • worker-src blob:;

Listening for when the locator has loaded

The <recycling-locator> will dispatch a custom "ready" event when the UI has rendered.

document
  .querySelector('recycling-locator')
  .addEventListener('ready', () => {
    console.info('Ready to recycle');
  });

Contributing

Looking to contribute to the code? A good starting point is the contributing docs.

FAQs

Package last updated on 03 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts