It may soon be easier to get your busted iPhone fixed.

Under a bill passed by the state legislature last week, digital electronics manufacturers – such as Apple or Samsung – will be required to make repair instructions and parts available to both consumers and independent technicians.

The “right to repair” legislation, which still needs to be signed into law by the governor, is believed to be the first of its kind in the United States. It follows a year-long campaign by tech and environmental activists, who accused manufacturers of intentionally restricting the ability to repair their products – a strategy known as planned obsolescence.

“This legislation ends what is a monopoly on the repair market by corporate actors and incentivizes competition within the industry,” said Assemblymember Patricia Fahy, the bill’s sponsor. “At the same time, we’d also help to reduce the 655,000 tons of toxic e-waste produced typically discarded in a single calendar year here in New York State.”

The legislation follows a years-long campaign from self-repair advocates, including the Public Interest Research Group. According to one study from the group, allowing American consumers to repair their electronics, rather than replacing them, would save $40 billion annually. The group said that electronic waste accounts for the country’s fastest growing waste stream, accounting for more than 6.9 million tons annually.

The New York legislation would apply to digital products such as phones and laptops, but would stop short of ensuring similar protections for medical devices or agriculture products, as some advocates had hoped.

If it is signed by Gov. Kathy Hochul, the legislation will take effect in one year.