The American practice of setting off fireworks on July 4 stretches back to the first Independence Day celebration in Philadelphia in 1777. Today, it’s a beloved tradition that almost seems impossible to replace.

But with concerns over air quality, wildfires and supply chains, some cities are doing just that.

This year Salt Lake City is replacing its fireworks with synchronized dancing drone displays to avoid worsening air quality and setting off more wildfires. Boulder, Colo., is switching to drones, too, and Minneapolis is opting for lasers, simply because those technologies have been easier to source than fireworks in recent years.

And as wildfire smoke from Canada again blanketed much of the United States last week, New York City officials debated whether to set off fireworks on the 4th but, as of Monday night, had not called them off.

Across the border, Montreal canceled July 1 Canada Day fireworks, citing poor air quality from the more than 100 wildfires burning across Quebec.

“They’re definitely going to compound those existing sources of air pollution,” said Grace Tee Lewis, an epidemiologist at the Environmental Defense Fund who specializes in air pollution and public health.

Fireworks cause a spike in a form of air pollution called particulate matter, the same type of pollution that is elevated from wildfire smoke. While there’s not much research on the risks of fireworks specifically, particulate matter less than 2.5 microns wide (about one-30th the width of a human hair) is known to enter people’s lungs and bloodstreams and cause breathing problems and inflammation. Children, older people and those with existing health conditions like asthma and chronic heart disease should take special care, Dr. Tee Lewis said.

“Watch it from a distance,” she recommended. “The closer you are, the more particulate matter exposure you’re going to have.”

Dr. Tee Lewis added that since the spread of the coronavirus, more people may be more vulnerable to air pollution, especially people suffering from long Covid or heart complications as a result of their infections. For those determined to get their pyrotechnic fix, wearing the same N95 face masks that protect against the virus is one way to protect yourself from smoke and air pollution, she said.

On July 4 and 5, fine particulate matter levels across the country rise by 42 percent on average, according to a 2015 study by the National Oceanic and Atmospheric Administration. Alongside the fireworks party, particulate matter pollution can rise as much as 370 percent.

These levels often exceed what’s allowed by the Environmental Protection Agency for day-to-day outdoor air quality, but local, state and tribal governments are generally allowed to flag one-time events like fireworks, as well as wildfires, as “exceptional events” and avoid officially violating national air standards.

Other countries see similar spikes in air pollution around their own major holidays, said Dian Seidel, an author of the 2015 study and a retired NOAA climate scientist.

Background air pollution from wildfire smoke is certainly something for cities to consider as they plan fireworks or alternative celebrations like drone shows, Dr. Seidel said. “Maybe there are ways not to be a party pooper, but to still have something pretty in the sky to look at, and not cause a big amount of pollution,” she said.

Besides air pollution, fireworks come with other risks. Dogs and other household pets are known to hate July 4, and many humane societies and animal shelters prepare for an influx of lost or runaway pets after the holiday. Fireworks lead to problems for wild animals, too. A 2022 study of wild geese in Europe found that during crucial rest stops on their long migrations, many birds abandoned their sleeping sites on New Year’s Eve.

In 2022, Americans suffered an estimated 10,200 fireworks-related injuries and 11 reported deaths, according to the U.S. Consumer Product Safety Commission. Many of the injuries resulted from smaller firecrackers and sparklers set off by people at home, not during large public or commercial shows.

But the adrenaline rush of sparks, whistles and booms, and a little bit of danger, socially acceptable for one day, is exactly why so many people love fireworks. Even Dr. Tee Lewis said her children set off small July 4 fireworks at their grandparents’ house, where they are legally allowed.

She and Dr. Seidel don’t want to stop the holiday festivities. They simply urge caution, and for people to consider alternatives.

In the end, holiday fireworks lead to just a couple of days of particularly visible air pollution. Around the country and around the world, communities deal with less visible but still unhealthy air daily or seasonally from things like vehicle traffic, industrial pollution and wildfires.

This year, the E.P.A. proposed strengthening its air quality standard for fine particulate matter to better protect public health, but said it would still allow special consideration for “exceptional events.”