  Highly magnetized neutron stars are a source of extreme transients observed
in different bands, like the fast radio burst (FRB) and associated hard X-ray
burst from the Galactic magnetar SGR 1935+2154. The origin of such outbursts,
hard X-rays on the one hand and millisecond duration FRBs on the other hand, is
still unknown. We present a global model for various kinds of such magnetar
outbursting activities. Crustal surface motions are expected to twist the inner
magnetar magnetosphere by shifting the frozen-in footpoints of magnetic field
lines. We discuss criteria for the development of instabilities of 3D twisted
flux bundles in the force-free dipolar magnetospheres and compare their
energetic properties to observations of magnetar X-ray flares. We then review a
recently developed FRB generation mechanism in the outer magnetosphere of a
magnetar. The strong magnetic pulse induced by a magnetar flare collides with
the current sheet of the magnetar wind, compresses and fragments it into a
self-similar chain of magnetic islands. Time-dependent plasma currents created
during their collisions produce relatively narrow-band GHz emission with
luminosities sufficient to explain bright extragalactic FRBs.
